简体   繁体   English

有没有办法将Gensim LDA输出与pyLDAvis图中的主题相匹配?

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

我需要处理LDA输出中的主题(lda.show_topics(num_topics = -1,num_words = 100 ...),然后比较我对pyLDAvis图的作用,但主题编号的编号不同。有没有办法我可以匹配吗?

If it's still relevant, have a look at the documentation http://pyldavis.readthedocs.io/en/latest/modules/API.html 如果它仍然相关,请查看文档http://pyldavis.readthedocs.io/en/latest/modules/API.html

You may want to set sort_topics to False . 您可能希望将sort_topics设置为False This way the order of topics in gensim and pyLDAvis will be the same. 这样,gensim和pyLDAvis中的主题顺序将是相同的。

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的索引从0开始,而pyLDAvis从1开始显示主题。不确定是否有一种直接的方法来解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM