What error cost my 3 days and how I overcome it.
As a part of academics I need to make implementation of the paper “Investigating COVID-19 News Across Four Nations: A Topic Modeling and Sentiment Analysis Approach” by Piyush Ghasiya and Others.
The paper was comparatively easy to understand and implement. But when i try to train Top2Vec model and save it, the model can be trained and can’t be saved. Due the modeling encoder is required as doc2vec and it requires a lot of computational resource and time it can’t be entertained.
AttributeError: 'Top2Vec' object has no attribute 'topics_indexed'
And it took my few days, I tried installing
pip install top2vec[sentence_encoders]
pip install top2vec[sentence_transformers]
pip install top2vec[indexing]
and reinstalling hnswlib, top2vec, etc. But no matter what, it was not working. I mean not able to save the top2vec model.
But after a while I read all the documentations, implementations, including repository issues of the model. Then I figured it out that it was the problem with newer version of top2vec and not specific to me. So I downgraded the version of top2vec and it worked.
top2vec 1.0.28 on python 3.8.0 worked fine for me.