|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
用gensim做LDA主题分析,提示属性错误
>>> from gensim import corpora,models
>>> dictionary=corpora.Dictionary(chaplist)
>>> corpus=[dictionary.doc2bow(text) for text in chaplist]
>>> 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)
|
|