code: def load_vocab(vocab_file):
      
      vocab = collections.OrderedDict()
      index = 0
      with io.open(vocab_file, 'r') as reader:
          while True:
              token = reader.readline()
              if not token:
                  break
              token = token.strip()
              vocab[token] = index
              index += 1
      return vocab
docs: Loads a vocabulary file into a dictionary.