Hello! What the correct way to handle this case?
User says: “show me schedule from Berlin to Paris”
My NLU.md configured like this:
nlu.md
## intent:schedule
- show me schedule from [Berlin](city) to [Paris](city)
My action.py configured like this:
actions.py
def slot_mappings(self):
return {'city_from': [self.from_entity(entity='city', intent=['inform', 'schedule']),
self.from_text(not_intent='deny')],
'city_to': [self.from_entity(entity='city', intent=['inform', 'schedule']),
self.from_text(not_intent='deny')]}
The problem: When I try to parse this text (localhost:5005/model/parse), Rasa can only recognize last entity “city” from input text:
Rasa reply
{
"intent": {
"name": "schedule",
"confidence": 0.9627386927604675
},
"entities": [
{
"start": **,
"end": **,
"value": "berlin",
"entity": "city",
"confidence": 0.9954288875630625,
"extractor": "CRFEntityExtractor",
}
]
...
}
Same problem with FormAction, even recognized entity ‘city’ did not filled slot ‘city_from’:
log from Core
2019-09-05 14:32:48 DEBUG rasa.core.processor - Received user message 'show me schedule from Berlin to Paris' with intent '{'name': 'schedule', 'confidence': 0.9627386927604675}' and entities '[{'start': **, 'end': **, 'value': 'Paris', 'entity': 'city',
'confidence': 0.9954288875630625, 'extractor': 'CRFEntityExtractor'}]'
log from Action
2019-09-05 14:32:38 DEBUG rasa_sdk.forms - Trying to extract requested slot 'city_from' ...
2019-09-05 14:32:38 DEBUG rasa_sdk.forms - Got mapping '{'type': 'from_entity', 'entity': 'city', 'intent': ['inform', 'schedule'], 'not_intent': []}'
2019-09-05 14:32:38 DEBUG rasa_sdk.forms - Got mapping '{'type': 'from_text', 'intent': [], 'not_intent': ['deny']}'
2019-09-05 14:32:38 DEBUG rasa_sdk.forms - Failed to extract requested slot 'city_from'
2019-09-05 14:32:38 ERROR rasa_sdk.endpoint - Failed to extract slot city_from with action schedule_form
What the correct way of extracting same entity for two slots?