BERTopic icon indicating copy to clipboard operation
BERTopic copied to clipboard

embedding_model and language cannot be both specified

Open julnow opened this issue 1 year ago • 2 comments

Hi,

I was playing with some changes in the embedding model, but when I initialized the BERTopic object with arguments: topic_model = BERTopic( language="multilingual", hdbscan_model=hdbscan_model, embedding_model=embedding_model, ) I got error "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()".

I think the line 216 of bertopic/_bertopic.py should be changed to self.language = language if embedding_model is None else None

julnow avatar Dec 21 '23 10:12 julnow

I will submit a PR in a moment

julnow avatar Dec 21 '23 10:12 julnow

Thanks for the PR. Let's first take a step back and let me confirm the issue. Could you share an end to end example and the full error log?

MaartenGr avatar Dec 21 '23 12:12 MaartenGr

After a while I cannot recreate this error, so I think this issue can be closed.

julnow avatar Feb 28 '24 13:02 julnow