A month ago I created a topic model and saved it as follows: topic_model.save(outpath, serialization="safetensors").
I then reduced the outliers in the model, new_topics = topic_model.reduce_outliers(docs, topics), and used it in an empirical analysis, but I did not save the model with the updated topics.
I now want to produce visualizations of the topics used in the analysis so I have loaded my dataframe (and defined docs again), loaded the model and tried to reduce the outliers again, but I get an error and I am not sure how to fix it. The code and error are below:
Hi!
A month ago I created a topic model and saved it as follows:
topic_model.save(outpath, serialization="safetensors")
.I then reduced the outliers in the model,
new_topics = topic_model.reduce_outliers(docs, topics)
, and used it in an empirical analysis, but I did not save the model with the updated topics.I now want to produce visualizations of the topics used in the analysis so I have loaded my dataframe (and defined docs again), loaded the model and tried to reduce the outliers again, but I get an error and I am not sure how to fix it. The code and error are below:
_sklearn.exceptions.NotFittedError: Vocabulary not fitted or provided__
I have also tried using
, but I got the same error.
Any help in how to fix this would be greatly appreciated.
Thanks in advance for your time!