-1

Using this command it is possible to present 10 topics.

ldamallet = gensim.models.wrappers.LdaMallet(mallet_path, corpus=corpus, num_topics=32, id2word=id2word)
pprint(ldamallet.show_topics(formatted=False))

How is it possible to print all topics and more than 10 words per topic?

rek
  • 177
  • 7
  • Does this answer your question? [How to print the LDA topics models from gensim? Python](https://stackoverflow.com/questions/15016025/how-to-print-the-lda-topics-models-from-gensim-python) – sophros Nov 08 '20 at 06:40
  • Please consider marking the answer as accepted (grey tick mark on the left of the answer) and upvoting it if you find it useful. – sophros Feb 15 '21 at 10:26

1 Answers1

1

Yes, it is enough to check in the documentation that show_topics takes also an argument num_words. Setting it up to 42 will give you 42 words per topic:

pprint(ldamallet.show_topics(num_words=42, formatted=False))
sophros
  • 14,672
  • 11
  • 46
  • 75