Comments (1)
Hi @lisabecker-ml6 , that's >should< be working well, although we'll check the other system dependencies.
First though, here's a session that starts clean with Py 3.8 on macOS, installs spaCy 3.3.1, then runs pytextrank:
(base) $ python3 -m venv venv
(base) $ source venv/bin/activate
(venv) (base) $ python3
Python 3.8.10 (v3.8.10:3d8993a744, May 3 2021, 08:55:58)
>>> ^D
(venv) (base) $ python3 -m pip install -U pip wheel
Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (21.1.1)
Collecting pip
Downloading pip-22.2.1-py3-none-any.whl (2.0 MB)
[ ... ]
Successfully installed pip-22.2.1 wheel-0.37.1
(venv) (base) $ python3 -m pip install spacy==3.3.1
Collecting spacy==3.3.1
Downloading spacy-3.3.1-cp38-cp38-macosx_10_9_x86_64.whl (6.5 MB)
[ ... ]
✔ Download and installation successful
You can now load the package via spacy.load('en_core_web_sm')
(venv) (base) $ python3 -m pip install -U pytextrank
Collecting pytextrank
Downloading pytextrank-3.2.3-py3-none-any.whl (30 kB)
[ ... ]
Successfully installed asttokens-2.0.5 colorama-0.4.5 cycler-0.11.0 executing-0.9.1 fonttools-4.34.4 graphviz-0.20.1 icecream-2.1.3 kiwisolver-1.4.4 matplotlib-3.5.2 networkx-2.8.5 pandas-1.4.3 pillow-9.2.0 pygments-2.12.0 pytextrank-3.2.3 python-dateutil-2.8.2 pytz-2022.1 scipy-1.8.1 six-1.16.0
(venv) (base) $ python3
Python 3.8.10 (v3.8.10:3d8993a744, May 3 2021, 08:55:58)
>>> import spacy
>>> import pytextrank
>>> nlp = spacy.load("en_core_web_sm")
>>> nlp.add_pipe("textrank")
<pytextrank.base.BaseTextRankFactory object at 0x7ff89edad760>
>>> text = "Compatibility of systems of linear constraints over the set of natural numbers."
>>> doc = nlp(text)
>>> for phrase in doc._.phrases:
... print(phrase)
...
Phrase(text='natural numbers', chunks=[natural numbers], count=1, rank=0.33223519667364926)
Phrase(text='linear constraints', chunks=[linear constraints], count=1, rank=0.22279697495861164)
Phrase(text='systems', chunks=[systems], count=1, rank=0.13804851507607008)
Phrase(text='Compatibility', chunks=[Compatibility], count=1, rank=0.12186027597311673)
Phrase(text='the set', chunks=[the set], count=1, rank=0.08772274252666795)
Depending on the system environment, installing with pip
inside of a Jupyter notebook can have some strange side effects – there's an entry on the spaCy forums where Sophie and I were troubleshooting a Python environment in a kernel in JupyterLab which logically never should have happened. It kept giving errors from a much earlier version of spaCy than what was being installed. Turns out that Jupyter was a bit sloppy about which Py environment it uses as a base for the Py kernel, and it wasn't following the environment variable settings.
When working in Jupyter, it can help for troubleshooting to get more system info:
import sys
print(sys.executable)
For example, the Python executable may be different than what's expected.
Based on the error message and the available factories, it looks like pytextrank isn't being installed in the same environment as the Python executable that the Jupyter kernel is running.
Alternatively, could you please try using a venv
instead of a notebook, with the commands shown above? That's one quick way to isolate whether there's a Py executable problem with Jupyter.
We'll get this fixed! :)
from pytextrank.
Related Issues (20)
- Biased Textrank implementation uses phrases instead of sentences HOT 4
- Information about the matrix similarity HOT 2
- NotImplementedError: [E894] The 'noun_chunks' syntax iterator is not implemented for language 'ru'. HOT 8
- Silence of the Lambs HOT 1
- ZeroDivisionError: division by zero in _calc_discounted_normalised_rank HOT 2
- Cannot use stopwords in PyTextRank HOT 3
- Demo: Term Weighting for Document Similarity Testing HOT 1
- Is `biasedtextrank` implemented? HOT 4
- Is it possible to integrate Pytextrank with Flair NLP engine HOT 1
- suggestion: allow "wildcard" POS for stopwords
- Doesn't work for Dutch language HOT 1
- DiGraph instead of Graph HOT 2
- Is handling of singular / plural forms ('sentence' and 'sentences') correct / consistent? HOT 3
- Bugfix for scrubber sample code which fails when scrubbing "two" HOT 2
- Update Sample Usage document: stop words must be lowercase HOT 3
- GitHub CI Actions for `pre-commit` are failing HOT 3
- different output HOT 6
- Dependency Management Pip-Tools Example HOT 1
- why the keyword phrase include a PRON, like "it" HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytextrank.