小编Kal*_*eem的帖子

如何在 bertopic 建模中获取每个主题的所有文档

我有一个数据集并尝试使用 berTopic 建模将其转换为主题,但问题是,我无法获取主题的所有文档。berTopic 每个主题仅返回 3 个文档。

topic_model  = BERTopic(verbose=True, embedding_model=embedding_model,
                                nr_topics = 'auto',
                                n_gram_range = (3,3),
                                top_n_words = 10,
                               calculate_probabilities=True, 
                              seed_topic_list = topic_list,
                              )
topics, probs = topic_model.fit_transform(docs_test)
representative_doc = topic_model.get_representative_docs(topic#1)
representative_doc
Run Code Online (Sandbox Code Playgroud)

该主题包含超过 300 个文档,但 bertopic 仅显示其中 3 个.get_representative_docs

nlp topic-modeling text-classification bert-language-model

9
推荐指数
1
解决办法
6045
查看次数