gensim 做LDA主题分析出现错误
用gensim做LDA主题分析,提示属性错误>>> from gensim import corpora,models
>>> dictionary=corpora.Dictionary(chaplist)
>>> corpus=
>>> from gensim.models.ldamodel import LdaModel
>>> lda=models.ldamodel.Ldamodel(corpus,id2word=dictionary,num_topics=10,passes=5)
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
lda=models.ldamodel.Ldamodel(corpus,id2word=dictionary,num_topics=10,passes=5)
AttributeError: module 'gensim.models.ldamodel' has no attribute 'Ldamodel'
后面两段代码,不应该这样的吗?
from gensim.models.ldamodel import LdaModel
lda=LdaModel(corpus,id2word=dictionary,num_topics=10,passes=5)
页:
[1]