MaartenGr / BERTopic

Leveraging BERT and c-TF-IDF to create easily interpretable topics.
https://maartengr.github.io/BERTopic/
MIT License
6.04k stars 757 forks source link

Issue when using topic representation #1943

Open dineshdisprz opened 5 months ago

dineshdisprz commented 5 months ago

When we use topic representation by openai , even when we specify top_n_words . it still takes in all the keyphrases and comes up with a topic representation . And The other issue is that as the chatgpt doesn't always return the response in the format that we need its better to include function calling internally in the topic representation block (openai) .

MaartenGr commented 5 months ago

When we use topic representation by openai , even when we specify top_n_words . it still takes in all the keyphrases and comes up with a topic representation .

Could you provide me with an example? That would make it easier for me to reproduce the issue. Also, which version of BERTopic are you using? I just released the v0.16.1 version which fixes many issues.

And The other issue is that as the chatgpt doesn't always return the response in the format that we need its better to include function calling internally in the topic representation block (openai) .

I think it should possible to implement function calling using their API but have not used it myself before. Having said that, I believe you can pass in **kwargs to their .create function which is where you would define those tools. So I think it's already possible.