Is there any way to match Gensim LDA output with topics in pyLDAvis graph?

Deadly 提交于 2020-08-27 06:31:55

问题


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?


回答1:


If it's still relevant, have a look at the documentation http://pyldavis.readthedocs.io/en/latest/modules/API.html

You may want to set sort_topics to False. This way the order of topics in gensim and pyLDAvis will be the same.

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.



来源:https://stackoverflow.com/questions/43260074/is-there-any-way-to-match-gensim-lda-output-with-topics-in-pyldavis-graph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!