AttributeError: [E046] while summarizing with PositionRank/Biased TextRank #252
-
Hello,
Unfortunately, it throws some AttributeError: [E046]. It looks like the
EDIT As I can see from
My code at the beginning compiles when changing the last line from |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hey @dblaszcz, That can be verified by type checking print(doc._.textrank)
# returns
# in case of textrank
# <class 'pytextrank.base.BaseTextRank'>
# in case of positionrank
# <class 'pytextrank.positionrank.PositionRank'>
# in case of biasedtextrank
# <class 'pytextrank.biasedrank.BiasedTextRank'> Also I see in the top snippet shared by you:
should be placed before
I hope it helps. |
Beta Was this translation helpful? Give feedback.
-
I've noticed that the pipeline extensions tend to not show up in the spaCy pipeline analysis, for example when running:
I can raise a question on the spaCy forums to find out if there are ways to register pipeline extensions. |
Beta Was this translation helpful? Give feedback.
-
I see the extension in the pipeline analysis using this snippet. import spacy
import pytextrank
nlp = spacy.load("en_core_web_sm")
nlp.add_pipe("positionrank", last=True)
assert "positionrank" in nlp.pipe_names
assert "positionrank" in nlp.analyze_pipes()['summary'] Output looks like this for me >>> nlp.analyze_pipes(pretty=True)['summary']
============================= Pipeline Overview =============================
# Component Assigns Requires Scores Retokenizes
- --------------- ------------------- -------- ---------------- -----------
0 tok2vec doc.tensor False
1 tagger token.tag tag_acc False
2 parser token.dep dep_uas False
token.head dep_las
token.is_sent_start dep_las_per_type
doc.sents sents_p
sents_r
sents_f
3 ner doc.ents ents_f False
token.ent_iob ents_p
token.ent_type ents_r
ents_per_type
4 attribute_ruler False
5 lemmatizer token.lemma lemma_acc False
6 positionrank False
✔ No problems found. maybe it's a version issue @ceteri ? (I'm using spacy=='3.0.6' and pytextrank=='3.1.2') for this test) |
Beta Was this translation helpful? Give feedback.
-
Thank you @louisguitton – |
Beta Was this translation helpful? Give feedback.
I see the extension in the pipeline analysis using this snippet.
Output looks like this for me