Hi ! I discover the release of Entity Roles a few days ago, and I was very excited because it’s exactly what I need.
So I tried to use it but I have a problem which I don’t understand.
In debug mode
I can see that my entity with good roles are detected, but my slot are not filled :
Here, an extract of my debug of my action :
2020-05-25 13:29:55 **DEBUG** rasa_sdk.executor - Received request to run 'action_create_new_fw_rule'
2020-05-25 13:29:55 **DEBUG** rasa_sdk.forms - There is no active form
2020-05-25 13:29:55 **DEBUG** rasa_sdk.forms - Activated the form 'action_create_new_fw_rule'
2020-05-25 13:29:55 **DEBUG** rasa_sdk.forms - Validating pre-filled required slots: {'action': 'deny'}
2020-05-25 13:29:55 **DEBUG** rasa_sdk.forms - Validating user input '{'intent': {'name': 'reseau_action', 'confidence': 0.999982118606567},
'entities': [{'entity': 'action', 'start': 8, 'end': 15, 'value': 'deny', 'extractor': 'DIETClassifier', 'processors': ['EntitySynonymMapper']},
{'entity': 'application', 'start': 27, 'end': 32, 'value': 'skype', 'extractor': 'DIETClassifier'},
{'entity': 'city-site', 'start': 40, 'end': 44, 'role': 'origin', 'value': 'Lyon', 'extractor': 'DIETClassifier'},
{'entity': 'city-site', 'start': 50, 'end': 55, 'role': 'destination', 'value': 'Milan', 'extractor': 'DIETClassifier'}],
'intent_ranking': [{'name': 'reseau_action', 'confidence': 0.999982118606567},
{'name': 'goodbye', 'confidence': 1.019166666083037e-05},
{'name': 'top_users', 'confidence': 2.59824651038798e-06}, {'name': 'affirm', 'confidence': 1.911080744321225e-06},
{'name': 'mood_great_return_question', 'confidence': 1.3031368553129141e-06},
{'name': 'bot_challenge', 'confidence': 5.347695264390495e-07}, {'name': 'what_day', 'confidence': 4.2057169480358414e-07},
{'name': 'temperature', 'confidence': 3.41710489237812e-07}, {'name': 'weather', 'confidence': 3.332550306822668e-07},
{'name': 'application_added', 'confidence': 2.248231680823664e-07}],
'text': 'peux tu bloquer le flux de skype depuis Lyon vers Milan ?'}'
2020-05-25 13:29:55 **DEBUG** rasa_sdk.forms - Validating extracted slots: {}
2020-05-25 13:29:55 **DEBUG** rasa_sdk.forms - No slots left to request, all required slots are filled:
action: deny
We can see that my city-site origin (Lyon) and destination (Milan) are recognized, but they are not extracted and used in my action.
Here, the beginning of my action, with the slot mapping.
class ActionCreateNewFWRule(FormAction):
def name(self) -> Text:
return "action_create_new_fw_rule"
@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""
return ["action"]
def slot_mappings(self) -> Dict[Text, Any]:
return {"action": self.from_entity(entity="moment",
intent=["action_added",
"reseau_action"]),
"application": self.from_entity(entity="application",
intent=["reseau_action"]),
"user": self.from_entity(entity="user",
intent=["reseau_action"]),
"service": self.from_entity(entity="service",
intent=["reseau_action"]),
"site_source": self.from_entity(entity="city-site", role="origin"),
"site_destination": self.from_entity(entity="city-site", role="destination"),
"department_source": self.from_entity(entity="department", role="origin"),
"department_destination": self.from_entity(entity="department", role="destination"),
"site_group_source": self.from_entity(entity="site_group", role="origin"),
"site_group_destination": self.from_entity(entity="site_group", role="destination"),
"address_source": self.from_entity(entity="address", role="origin"),
"address_destination": self.from_entity(entity="address", role="destination")}
I don’t want to put this slot in required because the user can be not precise them.
I hope you will can help me, because I don’t understand, I followed the tutorial about this : Introducing entity roles and groups
Thank you
EDIT : Finally, I think my problem is that my slots are not filled if the slot name is not the same of a entity name, but I don’t know why.