BERTopic 'list'对象不可调用

gywdnpxw  于 2个月前  发布在  其他
关注(0)|答案(7)|浏览(44)

I tried running the cell in the image below but got an error. moreover, if i run it by passing only docs, it runs perfectly well. so there is an issue with passing " Topic" as an input. Can you please guide me on what should i do.

mdfafbf1

mdfafbf11#

你能提供完整的代码吗?此外,你应该将所有主题传递给.hierarchical_topics以使其正常工作。

4ioopgfo

4ioopgfo3#

这是因为不需要传递 topics 。我建议查看这里的文档和这里的指南,了解如何应用层次主题建模以及可以传递哪些参数。确保阅读文档字符串和参数!

lkaoscv7

lkaoscv74#

我尝试传递链接函数= ward,代码运行了,但后来主题原本是16个,减少到了10个,不再匹配。

krcsximq

krcsximq5#

我不太清楚你遇到的问题是什么。你能提供一个最小化的例子吗?确保它包括完整的代码,这意味着源代码以及你可能使用的导入。这将帮助我更好地理解问题。

vngu2lb8

vngu2lb86#

The error mentioned above " 'list' object is not callable" is the issue i am facing

wqsoz72f

wqsoz72f7#

在这种情况下,你应该这样做:

topic_model.hierarchical_topics(docs)

而不是这样:

topic_model.hierarchical_topics(docs, topics)

请注意,我没有分享完整的代码,也没有创建可复现的例子。例如,不清楚函数 training 的作用或如何初始化 BERTopic。为了解决未来的疑问,请确保尽可能完整,这将使我更容易在我所能提供帮助的地方提供帮助!

相关问题