MaartenGr / MaartenGr/BERTopic

Zero-shot predefined Topics

Open
#2,164 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, Thanks again for your great tool,

I have a question regarding predefined Topics, whenver I add a list of **zeroshot_topic_list**, I got different generated topics and not the one I added, is there a way to only do topicmodeling based only on these **zeroshot_topic_list** ?

Code :

from bertopic import BERTopic
# Initialize and train BERTopic model
topic_model = BERTopic(
embedding_model=embedding_model,
vectorizer_model=vectorizer_model,
umap_model=umap_model,
calculate_probabilities=True,
#hdbscan_model=hdbscan_model,
representation_model=representation_model,
verbose=True,
nr_topics=15,
min_topic_size=25,
zeroshot_topic_list=zeroshot_topic_list,
zeroshot_min_similarity=.85

)

# Fit the topic model and transform the data
topics, probs = topic_model.fit_transform(df['PreprocessedText'].values)

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 the behavior with the provided BERTopic configuration, especially zeroshot_topic_list, zeroshot_min_similarity, and fit_transform. Determine whether the requested behavior is supported and define what it means for modeling to use only the predefined topics. Done means the expected topic assignments are produced or the limitation is documented clearly.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.