Python 3.x 通过corpora.csvcorpus在gensim LDA中输入CSV
我想用gensim中的LDA对几千个文档进行主题建模。 因此,我使用csv文件作为术语文档矩阵格式的输入 当前,运行以下代码时出现错误:Python 3.x 通过corpora.csvcorpus在gensim LDA中输入CSV,python-3.x,csv,gensim,lda,corpus,Python 3.x,Csv,Gensim,Lda,Corpus,我想用gensim中的LDA对几千个文档进行主题建模。 因此,我使用csv文件作为术语文档矩阵格式的输入 当前,运行以下代码时出现错误: from gensim import corpora import_path ="TDM.csv" dictionary = corpora.csvcorpus(import_path, labels='true') 错误如下: dictionary = corpora.csvcorpus(import_path, labels='true') Att
from gensim import corpora
import_path ="TDM.csv"
dictionary = corpora.csvcorpus(import_path, labels='true')
错误如下:
dictionary = corpora.csvcorpus(import_path, labels='true')
AttributeError: module 'gensim.corpora' has no attribute 'csvcorpus'
我是否正确使用了模块?如果是,我的错误在哪里
提前谢谢。这也困扰了我一段时间。 看起来csvcorpus实际上处于实验阶段,正如你在github上看到的 我建议使用老式的方式使用csv包来读取您的csv文件
干杯。我又运行了几次相同的代码,现在错误变为:dict=corpora.csvcorpus(import\u path,labels='true')TypeError:'module'对象不可调用现在有什么问题吗?好的,谢谢,我已经找到了解决模块csv的方法。