oborchers / Fast_Sentence_Embeddings

Compute Sentence Embeddings Fast!
GNU General Public License v3.0
619 stars 83 forks source link

Gensim version ImportError: cannot import name 'BaseKeyedVectors' #40

Closed robbiedood closed 3 years ago

robbiedood commented 3 years ago

Dear fse creator,

Below import gives ImportError: cannot import name 'BaseKeyedVectors'. from fse import SplitIndexedList

We think it's from the compatibility of gensim, so were wondering what is the gensim version we should use. (we are using the latest gensim 4.0.0)

This github issue suggests it should be from gensim.models.keyedvectors import KeyedVector

Best, -- Luke

robbiedood commented 3 years ago

Update: if we downgrade gensim to 3.8.3, it would work. Still hope to know the correct gensim version we should use to avoid potential errors.

AleMuzzi commented 3 years ago

Bug appeared in version 4.1.0 using the import

from fse.models import Average

found in this example https://towardsdatascience.com/vis-amz-83dea6fcb059. I managed to get gensim work downgrading it to version 3.8.3 .