MilaNLProc / contextualized-topic-models

A python package to run contextualized topic modeling. CTMs combine contextualized embeddings (e.g., BERT) with topic models to get coherent topics. Published at EACL and ACL 2021 (Bianchi et al.).
MIT License
1.21k stars 147 forks source link

ImportError: cannot import name 'CombinedTM' #147

Open vtriv07 opened 10 months ago

vtriv07 commented 10 months ago

Description

I am trying to run CombinedTM to create topics for a dataset of approximately 45000 messages. I used pip to install the library, and when it didn't work at first, I made sure that I used the most recent version of the library by using the --upgrade flag. This error is from running CombinedTM as part of a python file, but I also was thrown the same error when trying to use the interpreter.

When I try to upgrade to 2.2.2, I get thrown an error: DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality. Defaulting to user installation because normal site-packages is not writeable ERROR: Could not find a version that satisfies the requirement contextualized_topic_models==2.2.2 ERROR: No matching distribution found for contextualized_topic_models==2.2.2

What I Did

Traceback (most recent call last):
  File "combinedtm.py", line 1, in <module>
    from contextualized_topic_models.models.ctm import CombinedTM
ImportError: cannot import name 'CombinedTM'
vinid commented 10 months ago

Hello! i wonder if the error could be that you are using an old version of python. Do you have a virtualenv with a more recent one?

vtriv07 commented 10 months ago

I am using python 3.5.2. I do not have a virtualenv.