Skip to content

Update _bertopic.py to address #2316 #2317

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nhansendev
Copy link

Added "embeddings" kwarg to update_topics for use when pre-calculated document embeddings are used. Addresses issue #2316

What does this PR do?

Fixes #2316

Before submitting

  • This PR fixes a typo or improves the docs (if yes, ignore all other checks!).
  • Did you read the contributor guideline?
  • Was this discussed/approved via a Github issue? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes (if applicable)?
  • Did you write any new necessary tests?

Added "embeddings" kwarg to update_topics for use when pre-calculated document embeddings are used. Addresses issue MaartenGr#2316
@nhansendev
Copy link
Author

nhansendev commented Mar 25, 2025

The user could easily miss that they need to provide the embeddings to update_topics. Should there be some sort of warning? Maybe a check for whether "embeddings" and "self.embedding_model" are both None?

@MaartenGr
Copy link
Owner

Might indeed be nice to have such a check here but I'm not sure whether it would cover all cases considering the _create_topic_vectors also has a few different options for creating topic vectors.

@MaartenGr
Copy link
Owner

I'm rerunning all jobs since the error didn't relate to your code but a connection issue with huggingface.

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 this pull request may close these issues.

Can't get updated topic_embeddings_ when using pre-calculated document embeddings?
2 participants