2017-10-10 4 views
0

キーワード次のコードは、なしのキーワードを返して: - 私は取得しています機能は

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)) 

出力はNoneです。

答えて

0

パッケージのREADMEを参照してください。ランク付けされたフレーズを得るために必要なものが明確に記載されています。

r.extract_keywords_from_text(testscenario) 

は、指定されたテキストからキーワードを抽出します。

r.get_ranked_phrases() 
r.get_ranked_phrases_with_scores() 

を使用して、ランク付けしたスコアとその重みを取得します。

Readmeリンク:https://github.com/csurfer/rake-nltk/blob/master/README.md