有什么方法可以将Gensim LDA输出与pyLDAvis图中的主题进行匹配? [英] Is there any way to match Gensim LDA output with topics in pyLDAvis graph?

查看:496
本文介绍了有什么方法可以将Gensim LDA输出与pyLDAvis图中的主题进行匹配?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要处理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?

推荐答案

如果仍然有用,请查看文档

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图中的主题进行匹配?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆