Error: Can't find factory for 'textrank' for language English....
See original GitHub issueHi there,
Does any know how to fix below errors when running example code?
Thanks.
Traceback (most recent call last):
File “test.py”, line 14, in <module>
nlp.add_pipe(“textrank”)
File “/usr/local/lib64/python3.6/site-packages/spacy/language.py”, line 773, in add_pipe
validate=validate,
File “/usr/local/lib64/python3.6/site-packages/spacy/language.py”, line 639, in create_pipe
raise ValueError(err)
ValueError: [E002] Can’t find factory for ‘textrank’ 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, parser, beam_parser, entity_linker, ner, beam_ner, entity_ruler, lemmatizer, tagger, morphologizer, senter, sentencizer, textcat, textcat_multilabel, en.lemmatizer
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Hi @r76941156
It seems like you are trying to add
textrank
in the nlp pipeline without importing it.Adding this statement before
nlp.add_pipe("textrank")
should resolve the issue.import pytextrank
Please install latest pytextrank
pip install pytextrank==3.1.1
It should work with spacy 3.0.5
For more details please refer faq.