包中的函数rake_nltk返回 none 关键字



以下代码返回 None 关键字:-

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

我得到的输出是无。

可以使用以下代码。它对我有用。

from rake_nltk import Rake
r=Rake()
testscenario='This document is very important as it has a lot of business objectives mentioned in it.'
r.extract_keywords_from_text(testscenario)
print(r.get_ranked_phrases())

参考: https://pypi.org/project/rake-nltk/

请参阅软件包的自述文件。它清楚地描述了获得排名短语所需的内容

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

最新更新