code: def _get_token_encoder(vocab_dir, vocab_name, filename):
    
    vocab_path = os.path.join(vocab_dir, vocab_name)
    if not tf.gfile.Exists(vocab_path):
      _build_vocab(filename, vocab_path, 10000)
    return text_encoder.TokenTextEncoder(vocab_path)
docs: Reads from file and returns a `TokenTextEncoder` for the vocabulary.