sense2vec factory issue #10720
-
Following this blog item in Google Colab (with high ram) to try out sense2vec, I run into this error. Any suggestions on how to fix this? Here is the code cell: nlp = spacy.load("en_core_web_lg")
s2v = Sense2VecComponent(nlp.vocab).from_disk("/content/drive/MyDrive/RuBase/Corpora/sense2vec/s2v_reddit_2019_lg")
nlp.add_pipe("s2v")` And here's the error message: ValueError Traceback (most recent call last)
[<ipython-input-7-7af9fb234ba5>](https://localhost:8080/#) in <module>()
2 nlp = spacy.load("en_core_web_lg")
3 s2v = Sense2VecComponent(nlp.vocab).from_disk("/content/drive/MyDrive/RuBase/Corpora/sense2vec/s2v_reddit_2019_lg")
----> 4 nlp.add_pipe("s2v")
1 frames
[/usr/local/lib/python3.7/dist-packages/spacy/language.py](https://localhost:8080/#) in create_pipe(self, factory_name, name, config, raw_config, validate)
653 lang_code=self.lang,
654 )
--> 655 raise ValueError(err)
656 pipe_meta = self.get_factory_meta(factory_name)
657 # This is unideal, but the alternative would mean you always need to
ValueError: [E002] Can't find factory for 's2v' 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).
Available factories: attribute_ruler, tok2vec, merge_noun_chunks, merge_entities, merge_subtokens, token_splitter, doc_cleaner, parser, beam_parser, entity_linker, ner, beam_ner, entity_ruler, lemmatizer, tagger, morphologizer, senter, sentencizer, textcat, spancat, textcat_multilabel, sense2vec, en.lemmatizer |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
It may be that you're running into a version mismatch. What version of spaCy and sense2vec are you using? The sense2vec docs mention the usage for spaCy v3, if you're interested in using an older version, you should check this branch of the project. |
Beta Was this translation helpful? Give feedback.
-
Thanks for that quick response. I am using that page and am trying to replicate it in Google colab. So I did indeed have spaCy 2.2.4 . I uninstalled it and
|
Beta Was this translation helpful? Give feedback.
It may be that you're running into a version mismatch. What version of spaCy and sense2vec are you using?
The sense2vec docs mention the usage for spaCy v3, if you're interested in using an older version, you should check this branch of the project.