8

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?

m.khalil
  • 81
  • 4

1 Answers1

8

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.

formi23
  • 616
  • 7
  • 10