--- id: pytextrank version: "3.3.0" license: MIT License Copyright (c) 2016-2022 Derwen, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) license_treatment: permissive maintenance: active --- # 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. License: permissive · Maintenance: active · Downloads: 117.0K/mo ## What it is and what it does PyTextRank is a Python library that brings graph-based text analysis to spaCy by implementing the TextRank algorithm and related variants (PositionRank, Biased TextRank, TopicRank). It works as a spaCy pipeline component, meaning you load a language model, add the textrank pipe, and then process documents to extract ranked phrases and concepts. The library treats text as a graph of words and their relationships, then applies ranking algorithms to identify the most important phrases. The main use cases are phrase extraction—pulling the top-ranked keywords or key phrases from a document—and low-cost extractive summarization, where you identify the most important sentences or concepts without training a neural model. It also helps convert unstructured text into more structured representations suitable for knowledge graphs. The package depends on spaCy for NLP processing, networkx for graph operations, scipy for numerical work, and several smaller utilities (graphviz, pygments, icecream, GitPython) for visualization and debugging. Use it for: - Extract top-ranked phrases from research papers, articles, or documents for tagging or indexing - Perform low-cost extractive summarization by identifying key concepts without training a summarization model - Build knowledge graphs by extracting and ranking entities and relationships from unstructured text - Identify important keywords from customer feedback, reviews, or support tickets for categorization - Rank and filter candidate phrases for downstream NLP tasks like named entity linking or semantic search ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyTextRank implements graph-based TextRank and related algorithms as a spaCy pipeline extension to extract key phrases and perform extractive summarization on text documents. Yes. PyTextRank is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and offers a straightforward way to add graph-based phrase extraction to spaCy workflows. Install friction is low and the library is well-documented. Choose it if you need phrase extraction or concept ranking without the overhead of training custom models. ## Install pip install pytextrank uv add pytextrank poetry add pytextrank ## Installing pytextrank Before you install: Low install friction with a pure-Python wheel. Active maintenance with recent commits and a stable release history since 2017; requires spaCy and a language model as runtime dependencies. License in practice: MIT license permits commercial use, modification, and distribution with minimal restrictions—suitable for proprietary applications. Quickstart: python3 -m pip install pytextrank python3 -m spacy download en_core_web_sm import spacy import pytextrank nlp = spacy.load("en_core_web_sm") nlp.add_pipe("textrank") doc = nlp("Your text here") for phrase in doc._.phrases: print(phrase.text, phrase.rank) Requires a spaCy language model to be downloaded separately (e.g., en_core_web_sm for English); spaCy itself is a runtime dependency. Verify before relying: - Specific performance characteristics or scalability limits for large documents or corpora - Comparison of ranking quality across the four implemented algorithms (TextRank, PositionRank, Biased TextRank, TopicRank) - Memory footprint and computational cost relative to alternative phrase extraction methods ## Package facts - License: MIT License Copyright (c) 2016-2022 Derwen, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to… (full text in the JSON record) (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 117.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags phrase extraction from text, textrank implementation python, spacy pipeline nlp, extractive text summarization, keyword ranking algorithm, graph-based nlp, knowledge graph extraction, nlp, graph-algorithms, spacy-extension [View on SkillFed](https://skillfed.io/packages/pytextrank) · [View on PyPI](https://pypi.org/project/pytextrank/)