我试着在Gensim上运行一个简单的LDA模型:
from gensim import corpora
#text_data here is a list of tokens
dictionary = corpora.Dictionary(text_data)
corpus = [dictionary.doc2bow(text) for text in text_data]
lda = gensim.models.ldamodel.LdaModel(corpus=corpus, num_topics=5, id2word=dictionary, passes=15)
得到以下错误:
^{pr2}$我尝试过from numpy import random
,但似乎不起作用,也不确定为什么会抛出这个错误。在
有什么建议吗?在
编辑:重新启动Python和Spyder解决了这个问题。在
目前没有回答
相关问题 更多 >
编程相关推荐