MaartenGr / MaartenGr/BERTopic
using representation model takes much longer
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.8k
- Forks
- 920
- Avg merge
- 22h 24m
- Merged PRs (30d)
- 5
Description
Hello i am running BERTopic on a mabook pro m1 with the following parameters using precomputed embeddings with sentence transformer
```
vectorizer_model = CountVectorizer(stop_words="english")
ctfidf_model = ClassTfidfTransformer(reduce_frequent_words=True)
representation_model = OpenAI(openai_client, model="gpt-3.5-turbo", delay_in_seconds=10, chat=True)
BERTopic(
vectorizer_model = vectorizer_model,
ctfidf_model = ctfidf_model,
nr_topics = 'auto',
min_topic_size = max(int(len(docs)/800),10),
representation_model = representation_model )
```
i noticed a big difference in the fitting time of the model using the representation model, 5 min without, 35 min with
is there a particular reason for that? since it is something that should be run at the end of the entire process of topic modeling it should not take 30 min to retrieve keywords and docs and send a prompt to chat gpt, maybe there is something happening that i am not aware of, thanks in advance
is there maybe a possibility to add the representation layer after fitting the model?
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 the reported BERTopic fitting times with and without the shown OpenAI representation_model settings. Trace when representation processing occurs and assess whether it can be applied after fitting; done means providing a supported post-fit workflow or clearly documenting why the extra time is expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100