2017-10-10 45 views
0

下面的代码返回无关键字: -功能在rake_nltk包返回无关键字

from rake_nltk import Rake 

r=Rake() 
testscenario='''This document is very important as it has a lot of business objectives mentioned in it.''' 
defect='''Current day per security file is going to Bloomberg and we are getting data back from Bloomberg but it is not loading into the MarkIt tables. Last date on MarkIt tables for data loaded was June 29, 2016.BBG Run date for what is going into per security matcher is June 29th.See attached for screen shots.''' 
print(r.extract_keywords_from_text(testscenario)) 

,我得到的输出是无。

回答

0

请参阅包装自述文件。它清楚地描述你需要什么来获得排名短语

r.extract_keywords_from_text(testscenario) 

从给定的文本中提取关键字。使用

r.get_ranked_phrases() 
r.get_ranked_phrases_with_scores() 

获得排名分数和他们的权重。

自述链接:https://github.com/csurfer/rake-nltk/blob/master/README.md