Combine zero-shot classification with keywords list #2050
-
Let's say I've created some custom topics:
Then I've "assigned" some keywords to those topics:
Is there a way to model this kind of relationship in BERTopic? So maybe the model will consider the keywords assigned to each topic somehow? Something like a combo of One way would be to just join the keywords and append them to the corresponding topics, e.g.:
or the other way around is to add topics as a new keyword:
But both approaches seem weird to me... Just curious that's possible. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hmmm, there is indeed no such option with zero-shot topic modeling at the moment but you can seed words instead. It allows you to increase the potential weight of certain potential keywords that might end up in your topic representations. It would, however, not be specific to those topics and increase their weights across all topics. |
Beta Was this translation helpful? Give feedback.
Just to be sure I understand correctly, do you want the keywords to affect the topic assignment or the topic representation?
If it is the topic assignment, then your approach of concatenating the zero-shot label and keywords is actually quite reasonable! Embedding models typically work by merging word embeddings so adding them here makes sense to me. You could make this more complex by embedding the keywords and documents separately and then applying cosine similarit…