Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Warning when plotting MDS with two few topics #2247

Open
ajdapretnar opened this issue Dec 20, 2024 · 1 comment · May be fixed by #2254
Open

Issue Warning when plotting MDS with two few topics #2247

ajdapretnar opened this issue Dec 20, 2024 · 1 comment · May be fixed by #2254

Comments

@ajdapretnar
Copy link

Feature request

I propose having a nice explainable warning that informs the user one cannot plot MDS with insufficient number of topics.

Motivation

The issue was opened many times: #1914, #1010, #725, #378. This means people get confused by the original error. Having an integrated error issued after a check on the number of topics in the topic model would be beneficial.

Your contribution

I looked into the code, but honestly didn't know where such a warning would be most appropriate and how to format it.

@MaartenGr
Copy link
Owner

If I'm not mistaken, you would like to see an error raised when .visualize_topics() is used with too few topics, right?

In that case, I think the best place to do this would be here:

https://github.com/MaartenGr/BERTopic/blob/master/bertopic/plotting/_topics.py

There, we can check how many topics the topic model has and raise an error before doing any other calculations.

@ajdapretnar ajdapretnar linked a pull request Dec 23, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants