【发布时间】:2021-01-02 18:28:23
【问题描述】:
作为参考,我已经看过以下问题:
我希望通过 Gensim 训练我的 LDA 模型,根据模型创建的主题之一对句子进行分类。 排长队的东西
lda = models.LdaModel(corpus=corpus, id2word=id2word, num_topics=7, passes=20)
lda.print_topics()
for line in document: # where each line in the document is its own sentence for simplicity
print('Sentence: ', line)
topic = lda.parse(line) # where the classification would occur
print('Topic: ', topic)
我知道 gensim 没有parse 功能,但是如何实现呢?这是我一直在关注的文档,但我没有得到它:
提前致谢。
编辑:更多文档-https://radimrehurek.com/gensim/models/ldamodel.html
【问题讨论】:
标签: python python-3.x gensim lda