def populate_word_blacklist(word_index):
blacklisted_words = set()
blacklisted_words |= set(global_config.predefined_word_index.values())
if global_config.filter_sentiment_words:
blacklisted_words |= lexicon_helper.get_sentiment_words()
if global_config.filter_stopwords:
blacklisted_words |= lexicon_helper.get_stopwords()
global_config.predefined_word_index.values()are indices of some words, not words.global_config.predefined_word_indexis equal toword_index, not only{'<unk>': 0,'<sos>': 1,'<eos>': 2}.blacklisted_wordscontains unnecessary words and does not match the meaning of the blacklist.