MartinoMensio / spacy-universal-sentence-encoder

Google USE (Universal Sentence Encoder) for spaCy
MIT License
176 stars 12 forks source link

ValueError when loading the model #21

Closed cayadehaas closed 2 years ago

cayadehaas commented 2 years ago

Hi Martino,

I am relatively new to all of this. I tried to load the model in all three options you mentioned in the readme. However, I receive the following error:

ValueError: [E002] Can't find factory for 'universal_sentence_encoder' for language English (en). This usually happens when spaCy calls nlp.create_pipe with a custom component name that's not registered on the current language class. If you're using a Transformer, make sure to install 'spacy-transformers'. If you're using a custom component, make sure you've added the decorator @Language.component (for function components) or @Language.factory (for class components).

Could you help me out?

Kind regards, Caya de Haas

MartinoMensio commented 2 years ago

Hi Caya, I am replying also here just for others that may have a similar problem.

In these cases please update to the latest version of the library/standalone packages (listed in the README.md) and the issue should be solved.

Which version do I have? To see the version you can do the following in python:

import spacy_universal_sentence_encoder
spacy_universal_sentence_encoder.__version__

As of writing, the latest version is 0.4.3. Install with a command like this:

pip install https://github.com/MartinoMensio/spacy-universal-sentence-encoder/releases/download/v0.4.3/en_use_md-0.4.3.tar.gz#en_use_md-0.4.3

(Kept up to date with the latest version on the README.md)

Best, Martino