def load_vocab(self, vocab_filepath, min_count):
    'Load a previously saved vocabulary file.'
    logger.info('Loading word counts from file {}'.format(vocab_filepath))
    (self._words, self._counts, self._total_count) = ([], [], 0)
    with open(vocab_filepath, 'r', encoding='UTF-8') as vocab_stream:
        for line in vocab_stream:
            word_count = line.strip().split('\t', 1)
            (word, count) = (word_count[0], int(word_count[1]))
            if (count >= min_count):
                self._words.append(word)
                self._counts.append(count)
                self._total_count += count
    logger.info('Done loading word counts')
Load a previously saved vocabulary file.
def load_vocab(self, vocab_filepath, min_count):
    
    logger.info('Loading word counts from file {}'.format(vocab_filepath))
    (self._words, self._counts, self._total_count) = ([], [], 0)
    with open(vocab_filepath, 'r', encoding='UTF-8') as vocab_stream:
        for line in vocab_stream:
            word_count = line.strip().split('\t', 1)
            (word, count) = (word_count[0], int(word_count[1]))
            if (count >= min_count):
                self._words.append(word)
                self._counts.append(count)
                self._total_count += count
    logger.info('Done loading word counts')