Closed Anthonyive closed 3 years ago
Thanks for the bug report. I ran into some issues using PyTextRank to parse multiple documents with the same spaCy Language instance. Not sure if these persist in PTR v3, but the easiest thing to do would be to explicitly use an earlier version.
I just released v0.1.2 which enables Scattertext to work with PTR v3. The results on the convention data set look a little better using the new version.
How’s this going? I just got the same error, following the documentation:
https://spacy.io/universe/project/spacy-pytextrank
pytextrank has no attribute “TextRank”. It doesn’t appear in dir(pytextrank):
['BaseTextRank', 'BaseTextRankFactory', 'BiasedTextRank', 'BiasedTextRankFactory', 'Language', 'Lemma', 'MIN_PY_VERSION', 'Paragraph', 'Phrase', 'PositionRank', 'PositionRankFactory', 'Sentence', 'StopWordsLike', 'VectorElem', '_DEFAULT_CONFIG', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'version', '_check_version', '_create_component_br', '_create_component_pr', '_create_component_tr', '_versify', 'base', 'biasedrank', 'default_scrubber', 'filter_quotes', 'groupby_apply', 'maniacal_scrubber', 'pathlib', 'positionrank', 'split_grafs', 'typing', 'util', 'version']
I guess that Spacy page is just outdated because the official PTR GitHub has different instructions.
It looks like the spaCy documentation isn't current with the latest version of PyTextRank. You may want to raise an issue with them.
Scattertext's documentation, however, is current. Please follow that.
On Tue, Jan 18, 2022 at 6:52 AM Julius Hamilton @.***> wrote:
How’s this going? I just got the same error, following the documentation:
https://spacy.io/universe/project/spacy-pytextrank
pytextrank has no attribute “TextRank”. It doesn’t appear in dir(pytextrank):
['BaseTextRank', 'BaseTextRankFactory', 'BiasedTextRank', 'BiasedTextRankFactory', 'Language', 'Lemma', 'MIN_PY_VERSION', 'Paragraph', 'Phrase', 'PositionRank', 'PositionRankFactory', 'Sentence', 'StopWordsLike', 'VectorElem', '_DEFAULT_CONFIG', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'version', '_check_version', '_create_component_br', '_create_component_pr', '_create_component_tr', '_versify', 'base', 'biasedrank', 'default_scrubber', 'filter_quotes', 'groupby_apply', 'maniacal_scrubber', 'pathlib', 'positionrank', 'split_grafs', 'typing', 'util', 'version']
— Reply to this email directly, view it on GitHub https://github.com/JasonKessler/scattertext/issues/92#issuecomment-1015488284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACMMXC66G6OSZZDFQEB7ULUWV5BJANCNFSM4YYRBG2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you modified the open/close state.Message ID: @.***>
nlp.add_pipe("textrank")
Steps to Reproduce
Error:
Expected behavior
No error.
Environment
conda
,pip
, source):pipenv
Additional context
Looks like
pytextrank
no longer has the attributeTextRank
. Maybe you should change the code inscattertext/features/PyTextRankPhrases.py
fromtr = pytextrank.TextRank()
to spacy pipeline.