#def load_glove(self, EMBEDDING_FILE)和def load_para(self, EMBEDDING_FILE)下的
embeddings_index = dict(get_coefs(*o.split(" ")) for o in open(EMBEDDING_FILE,encoding='UTF-8'))
# Load embeddings from file if we choose to do so
if load_embeds:
# Load embedding matrix from file path - change path to where you saved them
# _*_ coding:utf-8 _*_
embedding_matrix = P.load_glove("D:\glove.6B\glove.6B.300d.txt")
else:
embedding_matrix = None
run_20newsgroups.py
用到load_20newsgroups.py产物
可自行调参
pyLDAvis因"Vocabulary size did not match size of word vectors"报错,以下为报错行(最后一行,可视化)
# Visualize topics with pyldavis
utils.generate_ldavis_data(data_path, m, idx_to_word, freqs, vocab_size)