'Load vocab from a file.'

def _init_vocab_from_file(self, filename):

    def token_gen():
        with tf.gfile.Open(filename) as f:
            for line in f:
                token = line.strip()
                (yield token)
    self._init_vocab(token_gen())
