def _GetVocabulary(vocab_filepath):
  """Maps the first word in each line of the given file to its line number."""
  vocab = {}
  with open(vocab_filepath, 'r') as vocab_file:
    for i, line in enumerate(vocab_file):
      word = line.strip('\r\n ').split(' ')[0]
      if word:
        vocab[word] = i
  return vocab