RAKE: Rapid automatic keyword extraction
Differences in regular expressions and stopword lists have big impacts on this algorithm and sticking close to the python means that the code was easy to compare to ensure that it was in the ballpark.
It operates using only the text you give it and produces surprisingly good results. There are likely better results possible but these mostly seem to involve a combination of Python, Machine Learning and a corpus of data.
The appeal of RAKE is of the "bang for the buck" variety.
Currently this library produces subtly different results than either the paper or the original Python implementation. While the results (especially the top scoring ones) line up nicely, these little deviations represent something to understand and resolve.
npm i rapid-automated-keyword-extraction
> var rake = defaultundefined>'natural numbers': 4'linear constraints': 4set: 1systems: 1compatibility: 1
The stopword list used by the python version is here. It has a comment as the first line which might break the world...
Links to other stopword lists can be found here
Any file with one word per line should be fine.
After hammering out differences in the results, plans are to focus on
- Fully embracing JS idioms (Promises/ES201X)
- Explore ways to improve the results as described here
- Options to control result format (number, result|result+rank, etc)
- Include default stopword list.
- Improve handling of special characters and italics
- Deal with sentences that have been split over multiple lines (sentence now ends with -)