How to print the LDA topics models from gensim? Python

后端 未结 10 1642
北荒
北荒 2020-12-04 13:42

Using gensim I was able to extract topics from a set of documents in LSA but how do I access the topics generated from the LDA models?

When printing the

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 14:25

    Recently, came across a similar issue while working with Python 3 and Gensim 2.3.0. print_topics() and show_topics() weren't giving any error but also not printing anything. Turns out that show_topics() returns a list. So one can simply do:

    topic_list = show_topics()
    print(topic_list)
    

提交回复
热议问题