MaartenGr / BERTopic

Leveraging BERT and c-TF-IDF to create easily interpretable topics.
https://maartengr.github.io/BERTopic/
MIT License
5.98k stars 751 forks source link

Some unexpected errors when import the libary #982

Closed cauzp closed 1 year ago

cauzp commented 1 year ago

When I started to import the library, there was an error reported, which was very strange. image

cauzp commented 1 year ago

I am using python version 3.9 and bertopic version 0.13.0

MaartenGr commented 1 year ago

Although I am not familiar with the error, I believe this is an environment issue. It might be worthwhile to start from a completely fresh environment and install BERTopic there.

cauzp commented 1 year ago

Although I am not familiar with the error, I believe this is an environment issue. It might be worthwhile to start from a completely fresh environment and install BERTopic there. Greetings, esteemed author! Thank you very much for your advice. I have tried to reinstall based on python 3.7 yesterday and it failed in the end. If possible, can you recommend a version of python with better compatibility and a Bertopic version that is compatible with it? When I used the colab service you provided, it worked fine. It would be very helpful if you could provide me with a documentation of requirements based on your current environment.

MaartenGr commented 1 year ago

I would advise trying it out with python 3.8 as python 3.7 will stop getting security updates pretty soon. If you get an error with python 3.8, could you share the entire error message?

cauzp commented 1 year ago

I would advise trying it out with python 3.8 as python 3.7 will stop getting security updates pretty soon. If you get an error with python 3.8, could you share the entire error message? Dear MaartenGr: I am glad to get your reply. Your prompt response is greatly appreciated. I've been trying this all day, using multiple versions of python cores from 3.6 to 3.9, and finally found that python 3.8 has good support for this project. Just install the hdbscan package first, then install bertopic, and then follow the prompts to install other auxiliary packages to work properly. I hope my sharing can bring some help to other people who have similar troubles. Also, I would like to ask you if it is possible to easily display the keywords in the topic as a wordcloud. I referenced your reply to a researcher using the Korean language model, but that solution no longer seems to be compatible due to updates to the relevant libraries.

MaartenGr commented 1 year ago

There is an issue about how to generate a worcloud here that has some example code that you can use.