我有一个工作装置
rasa_nlu
,在macOS High Sierra上运行Python3.6.5。我能让示例教程正常工作。我在使用同义词时遇到了麻烦。
first-model.md
.
## intent:select
- what is the [max](operator) rating?
## synonym:max
- best
- highest
- maximum
拉萨
正确检测问题的意图和实体,如
what is the max rating?
{'intent': {'name': 'select', 'confidence': 0.9542820453643799},
'entities': [{'start': 12,
'end': 15,
'value': 'max',
'entity': 'operator',
'confidence': 0.8146240434922525,
'extractor': 'ner_crf'}],
'intent_ranking': [{'name': 'select', 'confidence': 0.9542820453643799},
{'name': 'identity', 'confidence': 0.036332450807094574}],
'text': 'what is the max rating?'}
但是,当我在问题中使用同义词时,它不会检测到实体。例如,
what is the best rating?
{'intent': {'name': 'select', 'confidence': 0.9382177591323853},
'entities': [],
'intent_ranking': [{'name': 'select', 'confidence': 0.9382177591323853},
{'name': 'identity', 'confidence': 0.10226328670978546}],
'text': 'what is the best rating?'}
别跟同义词掷骰子。我都试过了
spacy_sklearn
和
tensorflow_embedding
非常感谢你的指点。
更新:
## intent:select
- what is the [max](operator) rating?
- what is the [highest](operator:max) rating?
- what is the [maximum](operator:max) rating?
- what is the [best](operator:max) rating?
虽然它改善了情况,但并不能完全解决问题。现在系统返回每个同义词(例如。
highest
,
maximum
,
best
max
). 例如,如果我问
,我想
最大值
作为实体值,而不是
. 不幸的是,系统返回
最好的
.
{'intent': {'name': 'select', 'confidence': 0.9736428260803223},
'entities': [{'start': 12,
'end': 16,
'value': 'best',
'entity': 'operator',
'confidence': 0.9105035376516767,
'extractor': 'ner_crf'}],
'intent_ranking': [{'name': 'select', 'confidence': 0.9736428260803223},
{'name': 'identity', 'confidence': 0.0}],
'text': 'what is the best rating?'}