{"id":15014105,"url":"https://github.com/derwenai/pytextrank","last_synced_at":"2026-10-19T08:49:06.821Z","repository":{"id":37396588,"uuid":"69814684","full_name":"DerwenAI/pytextrank","owner":"DerwenAI","description":"Python implementation of TextRank algorithms (\"textgraphs\") for phrase extraction","archived":false,"fork":false,"pushed_at":"2026-06-24T03:52:57.000Z","size":1710,"stargazers_count":2222,"open_issues_count":26,"forks_count":332,"subscribers_count":61,"default_branch":"main","last_synced_at":"2026-10-13T05:24:29.044Z","etag":null,"topics":["graph-algorithms","machine-learning","natural-language","natural-language-processing","nlp","python","spacy","spacy-extension","summarization","textgraphs","textrank"],"latest_commit_sha":null,"homepage":"https://derwen.ai/docs/ptr/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DerwenAI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":"CITATION","codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"github":"ceteri"}},"created_at":"2016-10-02T18:39:12.000Z","updated_at":"2026-10-11T01:43:32.000Z","dependencies_parsed_at":"2026-08-27T14:08:17.754Z","dependency_job_id":null,"html_url":"https://github.com/DerwenAI/pytextrank","commit_stats":{"total_commits":311,"total_committers":20,"mean_commits":15.55,"dds":0.3022508038585209,"last_synced_commit":"7cc079b1856e59cc3e4b53268a01b5e8893ca1ae"},"previous_names":["ceteri/pytextrank"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/DerwenAI/pytextrank","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerwenAI%2Fpytextrank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerwenAI%2Fpytextrank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerwenAI%2Fpytextrank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerwenAI%2Fpytextrank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DerwenAI","download_url":"https://codeload.github.com/DerwenAI/pytextrank/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DerwenAI%2Fpytextrank/sbom","scorecard":{"id":39521,"data":{"date":"2025-08-11","repo":{"name":"github.com/DerwenAI/pytextrank","commit":"e119be8516b4414734d89e73cd961b85a2e67ba0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":2,"reason":"Found 3/13 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/DerwenAI/pytextrank/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/DerwenAI/pytextrank/ci.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:33","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:35","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-66 / GHSA-562c-5r94-xh97","Warn: Project is vulnerable to: PYSEC-2019-179 / GHSA-5wv5-4vpf-pj6m","Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: GHSA-44cc-43rp-5947","Warn: Project is vulnerable to: GHSA-9q39-rmj3-p4r2","Warn: Project is vulnerable to: PYSEC-2017-18 / GHSA-98gj-wwxm-cj3h","Warn: Project is vulnerable to: PYSEC-2017-80 / GHSA-hpv5-v8g5-c864","Warn: Project is vulnerable to: GHSA-9jmq-rx5f-8jwq","Warn: Project is vulnerable to: GHSA-4952-p58q-6crx","Warn: Project is vulnerable to: GHSA-hwvq-6gjx-j797","Warn: Project is vulnerable to: PYSEC-2022-180 / GHSA-m87f-39q9-6f55","Warn: Project is vulnerable to: PYSEC-2022-212 / GHSA-v7vq-3x77-87vg","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: PYSEC-2023-206","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: GHSA-753j-mpmx-qq6g","Warn: Project is vulnerable to: GHSA-7cx3-6m66-7c5m","Warn: Project is vulnerable to: GHSA-8w49-h785-mj3c","Warn: Project is vulnerable to: PYSEC-2023-75 / GHSA-hj3f-6gcp-jg8j","Warn: Project is vulnerable to: GHSA-qppv-j76h-2rpx","Warn: Project is vulnerable to: GHSA-w235-7p84-xx57","Warn: Project is vulnerable to: GHSA-2g68-c3qc-8985","Warn: Project is vulnerable to: GHSA-f9vj-2wh5-fj8j","Warn: Project is vulnerable to: PYSEC-2023-221 / GHSA-hrfv-mqp8-q5rw","Warn: Project is vulnerable to: GHSA-q34m-jh98-gwm2","Warn: Project is vulnerable to: PYSEC-2024-4 / GHSA-2mqj-m65w-jghx","Warn: Project is vulnerable to: PYSEC-2023-165 / GHSA-cwvm-v4w8-q58c","Warn: Project is vulnerable to: PYSEC-2022-42992 / GHSA-hcpj-qp55-gfph","Warn: Project is vulnerable to: PYSEC-2023-137 / GHSA-pr76-5cm5-w9cj","Warn: Project is vulnerable to: PYSEC-2023-161 / GHSA-wfm5-v35h-vwf4","Warn: Project is vulnerable to: PYSEC-2023-117 / GHSA-mrwq-x4v8-fh7p","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-14T21:08:47.328Z","repository_id":37396588,"created_at":"2025-08-14T21:08:47.328Z","updated_at":"2025-08-14T21:08:47.328Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38352851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-algorithms","machine-learning","natural-language","natural-language-processing","nlp","python","spacy","spacy-extension","summarization","textgraphs","textrank"],"created_at":"2024-09-24T19:45:11.744Z","updated_at":"2026-10-19T08:49:06.443Z","avatar_url":"https://github.com/DerwenAI.png","language":"Python","funding_links":["https://github.com/sponsors/ceteri","https://github.com/sponsors/ceteri);"],"categories":[],"sub_categories":[],"readme":"# PyTextRank\n\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4637885.svg)](https://doi.org/10.5281/zenodo.4637885)\n![Licence](https://img.shields.io/github/license/DerwenAI/pytextrank)\n![Repo size](https://img.shields.io/github/repo-size/DerwenAI/pytextrank)\n![GitHub commit activity](https://img.shields.io/github/commit-activity/w/DerwenAI/pytextrank?style=plastic)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)\n![CI](https://github.com/DerwenAI/pytextrank/workflows/CI/badge.svg)\n![downloads](https://img.shields.io/pypi/dm/pytextrank)\n![sponsor](https://img.shields.io/github/sponsors/ceteri)\n\n**PyTextRank** is a Python implementation of *TextRank* as a\n[spaCy pipeline extension](https://spacy.io/universe/project/spacy-pytextrank),\nfor graph-based natural language work -- and related knowledge graph practices.\nThis includes the family of \n[*textgraph*](https://derwen.ai/docs/ptr/glossary/#textgraphs) algorithms:\n\n  - *TextRank* by [[mihalcea04textrank]](https://derwen.ai/docs/ptr/biblio/#mihalcea04textrank)\n  - *PositionRank* by [[florescuc17]](https://derwen.ai/docs/ptr/biblio/#florescuc17)\n  - *Biased TextRank* by [[kazemi-etal-2020-biased]](https://derwen.ai/docs/ptr/biblio/#kazemi-etal-2020-biased)\n  - *TopicRank* by [[bougouin-etal-2013-topicrank]](https://derwen.ai/docs/ptr/biblio/#bougouin-etal-2013-topicrank)\n\nPopular use cases for this library include:\n\n  - *phrase extraction*: get the top-ranked phrases from a text document\n  - low-cost *extractive summarization* of a text document\n  - help infer concepts from unstructured text into more structured representation\n\nSee our full documentation at: \u003chttps://derwen.ai/docs/ptr/\u003e\n\n\n## Getting Started\n\nSee the [\"Getting Started\"](https://derwen.ai/docs/ptr/start/)\nsection of the online documentation.\n\nTo install from [PyPi](https://pypi.python.org/pypi/pytextrank):\n```\npython3 -m pip install pytextrank\npython3 -m spacy download en_core_web_sm\n```\n\nIf you work directly from this Git repo, be sure to install the\ndependencies as well:\n```\npython3 -m pip install -r requirements.txt\n```\n\nAlternatively, to install dependencies using `conda`:\n```\nconda env create -f environment.yml\nconda activate pytextrank\n```\n\nThen to use the library with a simple use case:\n```python\nimport spacy\nimport pytextrank\n\n# example text\ntext = \"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.\"\n\n# load a spaCy model, depending on language, scale, etc.\nnlp = spacy.load(\"en_core_web_sm\")\n\n# add PyTextRank to the spaCy pipeline\nnlp.add_pipe(\"textrank\")\ndoc = nlp(text)\n\n# examine the top-ranked phrases in the document\nfor phrase in doc._.phrases:\n    print(phrase.text)\n    print(phrase.rank, phrase.count)\n    print(phrase.chunks)\n```\n\nSee the **tutorial notebooks** in the `examples` subdirectory for\nsample code and patterns to use in integrating **PyTextTank** with\nrelated libraries in Python:\n\u003chttps://derwen.ai/docs/ptr/tutorial/\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003eContributing Code\u003c/summary\u003e\n\nWe welcome people getting involved as contributors to this open source\nproject!\n\nFor detailed instructions please see:\n[CONTRIBUTING.md](https://github.com/DerwenAI/pytextrank/blob/main/CONTRIBUTING.md)\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eBuild Instructions\u003c/summary\u003e\n\n\u003cstrong\u003e\nNote: unless you are contributing code and updates,\nin most use cases won't need to build this package locally.\n\u003c/strong\u003e\n\nInstead, simply install from\n[PyPi](https://pypi.python.org/pypi/pytextrank)\nor use [Conda](https://docs.conda.io/).\n\nTo set up the build environment locally, see the \n[\"Build Instructions\"](https://derwen.ai/docs/ptr/build/)\nsection of the online documentation.\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eSemantic Versioning\u003c/summary\u003e\n\nGenerally speaking the major release number of \u003cstrong\u003ePyTextRank\u003c/strong\u003e \nwill track with the major release number of the associated \u003ccode\u003espaCy\u003c/code\u003e\nversion.\n\nSee:\n[CHANGELOG.md](https://github.com/DerwenAI/pytextrank/blob/main/CHANGELOG.md)\n\u003c/details\u003e\n\n\u003cimg\n alt=\"thanks noam!\"\n src=\"https://raw.githubusercontent.com/DerwenAI/pytextrank/main/docs/assets/noam.jpg\"\n width=\"231\"\n/\u003e\n\n\n## License and Copyright\n\nSource code for **PyTextRank** plus its logo, documentation, and examples\nhave an [MIT license](https://spdx.org/licenses/MIT.html) which is\nsuccinct and simplifies use in commercial applications.\n\nAll materials herein are Copyright \u0026copy; 2016-2024 Derwen, Inc.\n\n\n## Attribution\n\nPlease use the following BibTeX entry for citing **PyTextRank** if you \nuse it in your research or software:\n```bibtex\n@software{PyTextRank,\n  author = {Paco Nathan},\n  title = {{PyTextRank, a Python implementation of TextRank for phrase extraction and summarization of text documents}},\n  year = 2016,\n  publisher = {Derwen},\n  doi = {10.5281/zenodo.4637885},\n  url = {https://github.com/DerwenAI/pytextrank}\n}\n```\n\nCitations are helpful for the continued development and maintenance of\nthis library.\nFor example, see our citations listed on\n[Google Scholar](https://scholar.google.com/scholar?q=related:5tl6J4xZlCIJ:scholar.google.com/\u0026scioq=\u0026hl=en\u0026as_sdt=0,5).\n\n\n## Kudos\n\nMany thanks to our open source [sponsors](https://github.com/sponsors/ceteri);\nand to our contributors:\n[@ceteri](https://github.com/ceteri),\n[@louisguitton](https://github.com/louisguitton),\n[@Ankush-Chander](https://github.com/Ankush-Chander),\n[@tomaarsen](https://github.com/tomaarsen),\n[@CaptXiong](https://github.com/CaptXiong),\n[@Lord-V15](https://github.com/Lord-V15),\n[@anna-droid-beep](https://github.com/anna-droid-beep),\n[@dvsrepo](https://github.com/dvsrepo),\n[@clabornd](https://github.com/clabornd),\n[@dayalstrub-cma](https://github.com/dayalstrub-cma),\n[@kavorite](https://github.com/kavorite),\n[@0dB](https://github.com/0dB),\n[@htmartin](https://github.com/htmartin),\n[@williamsmj](https://github.com/williamsmj/),\n[@mattkohl](https://github.com/mattkohl),\n[@vanita5](https://github.com/vanita5),\n[@HarshGrandeur](https://github.com/HarshGrandeur),\n[@mnowotka](https://github.com/mnowotka),\n[@kjam](https://github.com/kjam),\n[@SaiThejeshwar](https://github.com/SaiThejeshwar),\n[@laxatives](https://github.com/laxatives),\n[@dimmu](https://github.com/dimmu), \n[@JasonZhangzy1757](https://github.com/JasonZhangzy1757), \n[@jake-aft](https://github.com/jake-aft),\n[@junchen1992](https://github.com/junchen1992),\n[@shyamcody](https://github.com/shyamcody),\n[@chikubee](https://github.com/chikubee);\nalso to [@mihalcea](https://github.com/mihalcea) who leads outstanding NLP research work,\nencouragement from the wonderful folks at Explosion who develop [spaCy](https://github.com/explosion/spaCy),\nplus general support from [Derwen, Inc.](https://derwen.ai/)\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=derwenai/pytextrank\u0026type=Date)](https://star-history.com/#derwenai/pytextrank\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderwenai%2Fpytextrank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderwenai%2Fpytextrank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderwenai%2Fpytextrank/lists"}