MaartenGr / MaartenGr/BERTopic

Skip topic representation when reducing topics wiht nr_topic parameter

Open
#1,932 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.