pytextrank: Python implementation of TextRank as a spaCy pipeline extension, for graph-based natural language work plus related knowledge graph practices; used for for phrase extraction of text documents. · Pythie
Python implementation of TextRank as a spaCy pipeline extension, for graph-based natural language work plus related knowledge graph practices; used for for phrase extraction of text documents.
Low maintenance activity.Last release over 2 years ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
PyTextRank is a Python implementation of TextRank as a
spaCy pipeline extension,
for graph-based natural language work -- and related knowledge graph practices.
This includes the family of
textgraph algorithms:
import spacy
import pytextrank
# example text
text = "Compatibility of systems of linear constraints over the set of natural numbers. Criteria of compatibility of a system of linear Diophantine equations, strict inequations, and nonstrict inequations are considered. Upper bounds for components of a minimal set of solutions and algorithms of construction of minimal generating sets of solutions for all types of systems are given. These criteria and the corresponding algorithms for constructing a minimal supporting set of solutions can be used in solving all the considered types systems and systems of mixed types."
# load a spaCy model, depending on language, scale, etc.
nlp = spacy.load("en_core_web_sm")
# add PyTextRank to the spaCy pipeline
nlp.add_pipe("textrank")
doc = nlp(text)
# examine the top-ranked phrases in the document
for phrase in doc._.phrases:
print(phrase.text)
print(phrase.rank, phrase.count)
print(phrase.chunks)
See the tutorial notebooks in the examples subdirectory for
sample code and patterns to use in integrating PyTextTank with
related libraries in Python:
https://derwen.ai/docs/ptr/tutorial/
Contributing Code
We welcome people getting involved as contributors to this open source
project!
Source code for PyTextRank plus its logo, documentation, and examples
have an MIT license which is
succinct and simplifies use in commercial applications.
Please use the following BibTeX entry for citing PyTextRank if you
use it in your research or software:
@software{PyTextRank,
author = {Paco Nathan},
title = {{PyTextRank, a Python implementation of TextRank for phrase extraction and summarization of text documents}},
year = 2016,
publisher = {Derwen},
doi = {10.5281/zenodo.4637885},
url = {https://github.com/DerwenAI/pytextrank}
}
Citations are helpful for the continued development and maintenance of
this library.
For example, see our citations listed on
Google Scholar.
RAKE short for Rapid Automatic Keyword Extraction algorithm, is a domain independent keyword extraction algorithm which tries to determine key phrases in a body of text by analyzing the frequency of word appearance and its co-occurance with other words in the text.