A Python implementation of the Rapid Automatic Keyword Extraction (RAKE) algorithm as described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010). Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan (Eds.), Text Mining: Theory and Applications: John Wiley & Sons.
了解该算法中的设计思维,关键词抽取的侧重点,对于后续的文本处理任务有很大帮助
开源地址:https://github.com/zelandiya/RAKE-tutorial
http://www.hlt.utdallas.edu/~saidul/code.html
https://pypi.org/project/yake/
from nlp_rake import rake stoppath = ‘data/stoplists/SmartStoplist.txt‘ rake_object = rake.Rake(stoppath, 5, 3, 4) sample_file = open("data/docs/fao_test/w2167e.txt", ‘r‘, encoding="iso-8859-1") text = sample_file.read() keywords = rake_object.run(text) # 3. print results print("Keywords:", keywords)
原文:https://www.cnblogs.com/demo-deng/p/13227253.html