BERTopic icon indicating copy to clipboard operation
BERTopic copied to clipboard

AttributeError: 'BERTopic' object has no attribute 'custom_labels'

Open AlexisV-hub opened this issue 3 years ago • 2 comments

Hi,

I was trying to manually set topics names by using :

loaded_sw_model_30.set_topic_labels({0: "Delivery"})

image

Thanks for your help,

Alexis

AlexisV-hub avatar Jul 15 '22 15:07 AlexisV-hub

Seeing as the name of our topic model is loaded_sw_model_30, I am assuming that it is an old model that you loaded in. If that is correct, then it might be the case that you are using an older version of BERTopic that does not have the set_topic_labels yet. For that, you will need the newest release, v0.11. However, there is a good chance you will have to re-train your model with the newest version as BERTopic does not support loading between versions.

MaartenGr avatar Jul 15 '22 17:07 MaartenGr

Thanks for the answer, problem solved !

AlexisV-hub avatar Jul 18 '22 16:07 AlexisV-hub