Load vocab from a file.

    Args:
      filename: The file to load vocabulary from.

def _init_vocab_from_file(self, filename):
    """Load vocab from a file.

    Args:
      filename: The file to load vocabulary from.
    """
    with tf.gfile.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)