Reviewing the results of BERTopic
Now, we are ready to inspect the outcome. We want to inspect the outcome of a topic model by inspecting the topic keywords and the count distribution across topics and show the representative documents for a topic. The BERTopic module has several convenient functions. They are as follows:
.get_topic_info()
: Get all topic information.get_topic_freq()
: Get topic frequency.get_topic(topic=12)
: Access a single topic, such as Topic 12.get_topics()
: Access all topics.get_document_info(docs)
: Get all document information.get_representative_docs()
: Get representative docs per topic
Getting the topic information
First, I am going to inspect the topic information by using .get_topic_info()
:
topic_model.get_topic_info()[0:20]
The top 20 topics are shown in Table 15.1:
Topic |
Count |
Name |
% ... |