question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Can't find factory for 'textrank' for language English....

See original GitHub issue

Hi 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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Ankush-Chandercommented, Mar 31, 2021

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

2reactions
Ankush-Chandercommented, Mar 31, 2021

Please install latest pytextrank pip install pytextrank==3.1.1

It should work with spacy 3.0.5

For more details please refer faq.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while loading spacy [E002] Can't find factory for 'tok2vec'
KeyError: "[E002] Can't find factory for 'tok2vec'. This usually happens when spaCy calls `nlp. create_pipe` with a component name that's not ...
Read more >
pytextrank - PyPI
PyTextRank is a Python implementation of TextRank as a spaCy pipeline extension, for graph-based natural language work -- and related knowledge graph practices....
Read more >
ValueError: [E002] Can't find factory for - Prodigy Support
I am currently having a hard time adding the second custom entity ruler - the one that tags units of measurement - and...
Read more >
Error loading Spacy BERT model | Data Science and ... - Kaggle
KeyError: "[E002] Can't find factory for 'pytt_wordpiecer'. This usually happens when spaCy calls nlp.create_pipe with a component name that's not built in ...
Read more >
Sample Usage - pytextrank - derwen.ai
import pytextrank import spacy nlp = spacy.load("en_core_web_sm") nlp.add_pipe("textrank ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found