(self, filename)
Load vocab from a file.

    Args:
      filename: The file to load vocabulary from.
Load vocab from a file.
Load vocab from a file .
def _init_vocab_from_file(self, filename):
    """Load vocab from a file.

    Args:
      filename: The file to load vocabulary from.
    """
    with tf.io.gfile.GFile(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)
def _init_vocab_from_file ( self , filename ) : with tf . io . gfile . GFile ( 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 )