MaartenGr / MaartenGr/BERTopic

I'm trying to use zeroshot topic model,but i encounter an error,Can anyone please help me?TypeError: BERTopic.__init__() got an unexpected keyword argument 'zeroshot_topic_list'

Open
#2,025 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

my bertopic version is bertopicv0.16.2

---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[162], [line 57](vscode-notebook-cell:?execution_count=162&line=57)
[55](vscode-notebook-cell:?execution_count=162&line=55) keybert_model = KeyBERTInspired()
[56](vscode-notebook-cell:?execution_count=162&line=56) # build BERTopic
---> [57](vscode-notebook-cell:?execution_count=162&line=57) topic_model = BERTopic(
[58](vscode-notebook-cell:?execution_count=162&line=58) embedding_model=embedding_model,
[59](vscode-notebook-cell:?execution_count=162&line=59) vectorizer_model=vectorizer_model,
[60](vscode-notebook-cell:?execution_count=162&line=60) # umap_model=umap_model,
[61](vscode-notebook-cell:?execution_count=162&line=61) # hdbscan_model=hdbscan_model,
[62](vscode-notebook-cell:?execution_count=162&line=62) zeroshot_topic_list = zeroshot_topic_list,
[63](vscode-notebook-cell:?execution_count=162&line=63) # seed_topic_list=seed_topic_list,
[64](vscode-notebook-cell:?execution_count=162&line=64) # representation_model=keybert_model
[68](vscode-notebook-cell:?execution_count=162&line=68) # #
[69](vscode-notebook-cell:?execution_count=162&line=69) topics, probs = topic_model.fit_transform(docs, embeddings=embeddings) #

TypeError: BERTopic.__init__() got an unexpected keyword argument 'zeroshot_topic_list'

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 with the BERTopic constructor used in the notebook and compare it with the v0.16.2 API. Reproduce the TypeError from the shown BERTopic initialization, then check the project documentation or release history for zeroshot_topic_list support. Done means identifying whether the argument is supported for that version and documenting the compatible usage or version.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.