我正在尝试更好地理解IBM Bluemix自然语言理解是如何工作的。docs
我找到了下面的例子。
import sys
import os
sys.path.append(os.path.join(os.getcwd(),'..'))
import watson_developer_cloud
import watson_developer_cloud.natural_language_understanding.features.v1 as features
nlu = watson_developer_cloud.NaturalLanguageUnderstandingV1(version='2017-02-27',
username='some_username',
password='some_password')
nlu.analyze(text='this is my experimental text. Bruce Banner is the Hulk and Bruce Wayne is BATMAN! Superman fears not Banner, but Wayne.',
features=[features.Entities(), features.Keywords()])它会生成以下输出:
{'entities': [{'count': 3,
'relevance': 0.915411,
'text': 'Bruce Banner',
'type': 'Person'},
{'count': 1, 'relevance': 0.296395, 'text': 'Wayne', 'type': 'Person'}],
'keywords': [{'relevance': 0.984789, 'text': 'Bruce Banner'},
{'relevance': 0.958833, 'text': 'Bruce Wayne'},
{'relevance': 0.853322, 'text': 'experimental text'},
{'relevance': 0.627454, 'text': 'Hulk'},
{'relevance': 0.619956, 'text': 'Superman'},
{'relevance': 0.583188, 'text': 'BATMAN'}],
'language': 'en'}此输出中的relevance是什么?它是如何计算的?我不需要详细的计算,因为它可能是专有的,但我希望有基本的了解。我还想知道keywords是如何识别的?是否有特定的语料库用于关键词识别?
IBM网站上的文档是有限的。
发布于 2017-06-12 06:06:06
你可以随时查看我们的非官方Watson Landing Page中的一些链接。它有上面提到的Rebook的链接,以及一个使用NLU的很好的chatbot implementation的链接。
发布于 2017-06-10 22:27:15
相关度:实体相关度得分,范围为0~ 1,0表示不相关,1表示高度相关。
有关更多细节,请参阅IBM红皮书https://www.redbooks.ibm.com/Redbooks.nsf/RedbookAbstracts/sg248398.html?Open。
https://stackoverflow.com/questions/44474154
复制相似问题