explosion / sense2vec

🦆 Contextually-keyed word vectors
https://explosion.ai/blog/sense2vec-reloaded
MIT License
1.63k stars 240 forks source link

import error #161

Open salihai opened 1 year ago

salihai commented 1 year ago

How can i solve this problem 'ImportError: cannot import name 'component' from 'spacy' (/usr/local/lib/python3.10/dist-packages/spacy/init.py)' ??

svlandeg commented 1 year ago

Hi! Can you provide more context on what it is you're trying to do? There is no component to be imported from spaCy. Perhaps share your code so I can better understand what's going on?

salihai commented 1 year ago

Here is my code:

import numpy as np from sense2vec import Sense2Vec s2v = Sense2Vec().from_disk('s2v_old')

svlandeg commented 1 year ago

Could it be that your s2v_old model was trained with spaCy v2, and you're now executing this with spaCy v3? spaCy v2 used to have an import for component in the language module.

Unfortunately v2 and v3 aren't compatible. For more background, have a look at our blog post: https://explosion.ai/blog/spacy-v3

With respect to sense2vec:

salihai commented 1 year ago

i will check it, thank you