class_docstr: Encoder based on a user-supplied vocabulary (file or list).
docstr: Load vocab from a file.
  
  Args:
  filename: The file to load vocabulary from.
code: def _init_vocab_from_file(self, filename):
      """Load vocab from a file.
  
      Args:
      filename: The file to load vocabulary from.
      """
      with open(filename) as f:
          tokens = [token.strip() for token in f.readlines()]
  
      def token_gen():
          for token in tokens:
              yield token
  
      self._init_vocab(token_gen(), add_reserved_tokens=False)
  
imports: import re
  import six
label_desc: Use image node_id 8 for calling the TokenTextEncoder obj's underlying member method code with example usage: obj._init_vocab_from_file(filename) without return types