BERTopic
BERTopic copied to clipboard
`seed_topic_list` throwing error related to inhomogeneous shape after 1 dimensions
I am using the following code to use seed_topic_list
embedding_model = 'all-mpnet-base-v2'
word_list = ["Bullion",'market','price','commodity',"precious", "metal",'gilt','carat','aurum','world', 'gold', 'council','mine','mining','bitcoin','forecast','bank','liquidity','ingot','stocks','delivery','settlement','ETF']
word_lists = [[word.lower()] for word in word_list]
model = BERTopic(
verbose=True,
min_topic_size=5,
language="english",
seed_topic_list = word_list,
embedding_model = SentenceTransformer(embedding_model)
)
topics, probs = model.fit_transform(df['news_article'])
I am getting the following error!
Can somebody tell me, what is the correct way to use seed_topic_list?
I believe this is a known issue. Could you check those for a solution? I believe it had something to do with specific versions of numpy.
@Adi-ds I downgraded my version of numpy to 1.22.4 and it worked for me. This link might help you. This link might help.