Add create_topic_taxonomy() method to _bertopic (#2526) - #2527
Open
TheItCrOw wants to merge 1 commit into
Open
Conversation
Author
|
Woops, 2 checks failed, let me fix them. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey @MaartenGr,
first off: great repository! It was really easy to get into it and we're using BERTopic extensively, which brings me to my PR:
What does this PR do?
create_topic_taxonomy(): controllable multi-level topic hierarchiesWe've been building topic taxonomies for our use case and ran into a gap between the existing options:
What we needed was a way to say "give me 3 levels with roughly X, Y, Z topics each, and make sure every parent has at least N children."
So we built create_topic_taxonomy(), which:
The method sits right next to hierarchical_topics() and follows existing code patterns. Feel free to checkout the Topic Taxonomy mkdocs page I have on my own Fork, which would be merged as well :)
Example
If you want to run it, just do:
We've added a dedicated documentation page to the mkdocs (Topic Taxonomy), the actual implementation is only a single method. :)
Before submitting