-
Hey there Maarteen, thank you very much for your nice work with BERTopic. It is very useful for my research! I have been playing around generating topic representations with llama cpp, but I would also like to keep the original topic names with their different words. However, when choosing llama cpp as a representation model the original topic names are replaced by llama cpp representations. Is this expected behaviour? Is it possible to preserve the original name column before the LLM gets called? Thank you for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Thank you for your kind words! You can do this by following the multiple representations documentation. Essentially, all you need to do is make sure that you create a dictionary of your representation model like so: from bertopic import BERTopic
from bertopic.representation import LlamaCPP
# Use llama.cpp to load in a 4-bit quantized version of Zephyr 7B Alpha
zephyr = LlamaCPP("zephyr-7b-alpha.Q4_K_M.gguf")
representation_model = {
"Zephyr": zephyr,
}
# Create our BERTopic model
topic_model = BERTopic(representation_model=representation_model, verbose=True) |
Beta Was this translation helpful? Give feedback.
Thank you for your kind words! You can do this by following the multiple representations documentation. Essentially, all you need to do is make sure that you create a dictionary of your representation model like so: