I have a working installation of rasa_nlu
, running Python 3.6.5 on macOS High Sierra. I was able to get the sample tutorial working. I'm running into trouble getting it to work with synonyms.
Here's the relevant portion of my training file, first-model.md
.
## intent:select
- what is the [max](operator) rating?
## synonym:max
- best
- highest
- maximum
Now, rasa_nlu
correctly detects the intent and entity for a question such as 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?'}
However, when I use a synonym in the question, it doesn't detect the entity. For example, 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?'}
No dice with synonym. I've tried this both with spacy_sklearn
and tensorflow_embedding
, and see similar results.
Would greatly appreciate any pointers.
Cheers.
Update: Per @Caleb's suggestion below, I updated the training to:
## 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?
While it improves the situation, it doesn't fully solve the problem. Now the system returns each synonym (e.g. highest
, maximum
, best
) as the entity value instead of the actual value (max
). For example, if I ask what is the best rating?
, I expect max
as the entity value, not best
. Unfortunately, the system returns best
.
{'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?'}