A Python package that implements RAKE algorithm for keyword extraction.
Rapid Automatic Keyword Extraction (RAKE) algorithm is proposed by Stuart Rose, Dave Engel, Nick Cramer, Wendy Cowley.
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps nlp-rake-eeeeeeeelias
from nlp_rake import rake_text
text = 'Compatibility of systems of...'
ranked_result = rake_text(text)
# [
# ('minimal generating sets', 8.67),
# ('linear diophantine equations', 8.5),
# ('minimal supporting set', 7.67),
# ...
# ]
import nlp_rake
text = 'Compatibility of systems of...'
tokens = nlp_rake.split_to_tokens(text)
phrases = nlp_rake.split_tokens_to_phrases(
tokens, stoplist=nlp_rake.ENGLISH_WORDS_STOPLIST
)
cooccurrence = nlp_rake.get_cooccurrence_graph(phrases)
degrees = nlp_rake.get_degrees(cooccurrence)
frequencies = nlp_rake.get_frequencies(cooccurrence)
ranked_result = nlp_rake.get_ranked_phrases(
phrases, degrees=degrees, frequencies=frequencies
)
# [
# ('minimal generating sets', 8.67),
# ('linear diophantine equations', 8.5),
# ('minimal supporting set', 7.67),
# ...
# ]
Check out some exercises I did for an online computational linguistics course.