{"id":15030522,"url":"https://github.com/csurfer/rake-nltk","last_synced_at":"2025-10-04T01:45:02.302Z","repository":{"id":16161056,"uuid":"79318410","full_name":"csurfer/rake-nltk","owner":"csurfer","description":"Python implementation of the Rapid Automatic Keyword Extraction algorithm using NLTK.","archived":false,"fork":false,"pushed_at":"2022-12-09T05:43:43.000Z","size":488,"stargazers_count":1069,"open_issues_count":26,"forks_count":150,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-04-06T17:05:58.962Z","etag":null,"topics":["algorithm","keyword-extraction","nltk","python","text-mining"],"latest_commit_sha":null,"homepage":"https://csurfer.github.io/rake-nltk","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/csurfer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-18T08:17:09.000Z","updated_at":"2025-04-06T08:53:45.000Z","dependencies_parsed_at":"2023-01-14T00:30:25.566Z","dependency_job_id":null,"html_url":"https://github.com/csurfer/rake-nltk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Frake-nltk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Frake-nltk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Frake-nltk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csurfer%2Frake-nltk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csurfer","download_url":"https://codeload.github.com/csurfer/rake-nltk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248781275,"owners_count":21160705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["algorithm","keyword-extraction","nltk","python","text-mining"],"created_at":"2024-09-24T20:13:35.333Z","updated_at":"2025-10-04T01:44:57.258Z","avatar_url":"https://github.com/csurfer.png","language":"Python","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3BSBW7D45C4YN\u0026lc=US\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted"],"categories":[],"sub_categories":[],"readme":"# rake-nltk\n\n[![pypiv](https://img.shields.io/pypi/v/rake-nltk.svg)](https://pypi.python.org/pypi/rake-nltk)\n[![pyv](https://img.shields.io/pypi/pyversions/rake-nltk.svg)](https://pypi.python.org/pypi/rake-nltk)\n[![Build Status](https://github.com/csurfer/rake-nltk/actions/workflows/pytest.yml/badge.svg?branch=master)](https://github.com/csurfer/rake-nltk/actions)\n[![codecov](https://codecov.io/gh/csurfer/rake-nltk/branch/master/graph/badge.svg?token=ghRhWVec9X)](https://codecov.io/gh/csurfer/rake-nltk)\n[![Licence](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/csurfer/rake-nltk/master/LICENSE)\n[![Downloads](https://pepy.tech/badge/rake-nltk)](https://pepy.tech/project/rake-nltk)\n\nRAKE 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.\n\n![Demo](http://i.imgur.com/wVOzU7y.gif)\n\n## Features\n\n* Ridiculously simple interface.\n* Configurable word and sentence tokenizers, language based stop words etc\n* Configurable ranking metric.\n\n## Setup\n\n### Using pip\n\n```bash\npip install rake-nltk\n```\n\n### Directly from the repository\n\n```bash\ngit clone https://github.com/csurfer/rake-nltk.git\npython rake-nltk/setup.py install\n```\n\n## Quick start\n\n```python\nfrom rake_nltk import Rake\n\n# Uses stopwords for english from NLTK, and all puntuation characters by\n# default\nr = Rake()\n\n# Extraction given the text.\nr.extract_keywords_from_text(\u003ctext to process\u003e)\n\n# Extraction given the list of strings where each string is a sentence.\nr.extract_keywords_from_sentences(\u003clist of sentences\u003e)\n\n# To get keyword phrases ranked highest to lowest.\nr.get_ranked_phrases()\n\n# To get keyword phrases ranked highest to lowest with scores.\nr.get_ranked_phrases_with_scores()\n```\n\n## Debugging Setup\n\nIf you see a stopwords error, it means that you do not have the corpus\n`stopwords` downloaded from NLTK. You can download it using command below.\n\n```bash\npython -c \"import nltk; nltk.download('stopwords')\"\n```\n\n## References\n\nThis is a python implementation of the algorithm as mentioned in paper [Automatic keyword extraction from individual documents by Stuart Rose, Dave Engel, Nick Cramer and Wendy Cowley](https://www.researchgate.net/profile/Stuart_Rose/publication/227988510_Automatic_Keyword_Extraction_from_Individual_Documents/links/55071c570cf27e990e04c8bb.pdf)\n\n## Why I chose to implement it myself?\n\n- It is extremely fun to implement algorithms by reading papers. It is the digital equivalent of DIY kits.\n- There are some rather popular implementations out there, in python([aneesha/RAKE](https://github.com/aneesha/RAKE)) and node([waseem18/node-rake](https://github.com/waseem18/node-rake)) but neither seemed to use the power of [NLTK](http://www.nltk.org/). By making NLTK an integral part of the implementation I get the flexibility and power to extend it in other creative ways, if I see fit later, without having to implement everything myself.\n- I plan to use it in my other pet projects to come and wanted it to be modular and tunable and this way I have complete control.\n\n## Contributing\n\n### Bug Reports and Feature Requests\n\nPlease use [issue tracker](https://github.com/csurfer/rake-nltk/issues) for reporting bugs or feature requests.\n\n### Development\n\n1. Checkout the repository.\n2. Make your changes and add/update relavent tests.\n3. Install **`poetry`** using **`pip install poetry`**.\n4. Run **`poetry install`** to create project's virtual environment.\n5. Run tests using **`poetry run tox`** (Any python versions which you don't have checked out will fail this). Fix failing tests and repeat.\n6. Make documentation changes that are relavant.\n7. Install **`pre-commit`** using **`pip install pre-commit`** and run **`pre-commit run --all-files`** to do lint checks.\n8. Generate documentation using **`poetry run sphinx-build -b html docs/ docs/_build/html`**.\n9. Generate **`requirements.txt`** for automated testing using **`poetry export --dev --without-hashes -f requirements.txt \u003e requirements.txt`**.\n10. Commit the changes and raise a pull request.\n\n### Buy the developer a cup of coffee!\n\nIf you found the utility helpful you can buy me a cup of coffee using\n\n[![Donate](https://www.paypalobjects.com/webstatic/en_US/i/btn/png/silver-pill-paypal-44px.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations\u0026business=3BSBW7D45C4YN\u0026lc=US\u0026currency_code=USD\u0026bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsurfer%2Frake-nltk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsurfer%2Frake-nltk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsurfer%2Frake-nltk/lists"}