MaartenGr / MaartenGr/BERTopic
Skip topic representation when reducing topics wiht nr_topic parameter
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 920
- Avg merge
- 22h 24m
- Merged PRs (30d)
- 5
Description
Hi,
I observed that when I reduce the topics by setting nr_topic = int, it runs topic representation before reducing the topics.
For example, if I have 1,800 topics and reduce (or merge) to 100 topics, it seems like it runs 1,800 representations and then re-runs 100 representations.
This is not efficient especially when I use the OpenAI API, since it uses API resources for what I don't need.
Is there any way to avoid the double representation by default? (Of course I can run the representation part after getting a model, but I'm just curious if that feature is implemented)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing topic reduction with nr_topic and trace when topic representation is invoked before and after reduction. Check the topic-reduction and representation flow to identify where the first pass can be skipped; done means reduced topics receive representation once without unnecessary API calls.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100