问题描述
我需要处理LDA输出中的主题(lda.show_topics(num_topics = -1,num_words = 100 ...),然后将我与pyLDAvis图进行比较,但是主题编号的编号不同.一种我可以匹配它们的方法?
I need to process the topics in the LDA output (lda.show_topics(num_topics=-1, num_words=100...) and then compare what I do with the pyLDAvis graph but the topic numbers are differently numbered. Is there a way I can match them?
推荐答案
如果仍然有用,请查看文档 http://pyldavis.readthedocs.io/en/latest/modules/API.html
If it's still relevant, have a look at the documentation http://pyldavis.readthedocs.io/en/latest/modules/API.html
您可能希望将sort_topics
设置为 False .这样,gensim和pyLDAvis中主题的顺序将是相同的.
You may want to set sort_topics
to False. This way the order of topics in gensim and pyLDAvis will be the same.
同时,gensim的索引从0开始,而pyLDAvis显示的主题从1开始.不确定是否有解决此问题的简单方法.
At the same time, gensim's indexing starts from 0, while pyLDAvis displays topics starting from 1.Not sure if there's a straightforward way to address this.
这篇关于有什么方法可以将Gensim LDA输出与pyLDAvis图中的主题进行匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!