def decode_bow_with_vocab_list(vocab_list):
  """Make function that decode sentence represented as bag of words.

  Args:
    vocab_list: all possible vocabularies

  Returns:
    a function that returns the string representation of a bow representation
      of a text, i.e. a string with each word repeated for amount of times
      specified by the bow
  """
  def _decode(bow_repr):
    base_string = ''
    for c, w in zip(bow_repr, vocab_list):
      for _ in range(int(c)):
        base_string += w + ' '
    return base_string
  return _decode