I have a form in which I have slots which would use the same entities. If I make two separate entities for them and duplicate the data, it will become problematic as the NLU may classify “current_country” as “destination_country” and vice versa. Therefore I only use one entity, and try to map them in the slots_mapping function in my form actions. Example code:
return {
'current_country': self.from_entity(
entity='country',
intent=['inform']
),
'destination_country': self.from_entity(
entity='country',
intent=['inform']
)
}
The problem with this is, since the intent is inform, it asks the first question: “What is your current country?” When I answer that, with lets say Estonia, it sets the value for both, current_country and destination_country, skipping the question for destination_country:
What is your current country?
Your input -> Estonia
2020-05-18 13:59:14 DEBUG rasa.core.processor - Current slot values:
current_country: Estonia
destination_country: Estonia
requested_slot: current_country
Obviously I want to be able to answer both questions separately, with separate values. Is there any way to do this cleanly through the slot_mappings?
For example, something like this (pseudocode):
return {
'current_country': self.from_entity(
entity='country',
response=['utter_ask_current_country'] # Only fill the slot on this response
),
'destination_country': self.from_entity(
entity='country',
response=['utter_ask_destination_country'] # Only fill the slot on this response
)
}
I’ve been trying different things and searching for solutions for hours, I’ve seen many similar questions, none of them have had a concrete answer.
I’m not sure if I’m missing something, as I can’t believe something like this, which should be an extremely common usecase, doesn’t have any official coverage at all.
Or is this the wrong approach for an usecase like this?