问题
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