使用此命令可以显示10个主题。
ldamallet = gensim.models.wrappers.LdaMallet(mallet_path, corpus=corpus, num_topics=32, id2word=id2word)
pprint(ldamallet.show_topics(formatted=False))
如何打印所有主题,并且每个主题超过10个字?
答案 0 :(得分:1)
是的,签入documentation就足以证明show_topics
也接受参数num_words
。将其设置为42将为每个主题提供42个单词:
pprint(ldamallet.show_topics(num_words=42, formatted=False))