were having a hard time to map an entity to a slot, when it doesnt have the same name and we dont explicitly ask for that slot. Looking into the rasa code, we find this line and were wondering if theres a reason why this condition has to be fullfilled.
We already got a few solutions but all feel like akward workarounds. So, why are only equally named entities allowed and not the ones the user specifies in the slot mappings?
I have tried using custom slots mapping and under some specific circumstances, it’s working fine for me (in some other circumstances it doesn’t). Can you expain what we don't explicity ask for that slot means ?
The FormAction makes a distinction between the actual required slot, where the full slot_mappings are used and other slots. For example you got a bot that sells train tickets and the required slots are number of seats, departure_place, arrival_place and date. Now the bot utters the utter_ask_arrival_place template
Bot: Where do you want to go?
User: i want to go to london tomorrow
So in this case the required slot was arrival_place, but the user also answered the date. Now, for the required slot, Rasa makes use of the whole specified slot mappings, but for the extra slot (that we did not explicitly ask for at that point!) its just mapped from entities with the exact same name (or some predefined value with the ‘from_trigger_input’), as you see in the code. I was curious whats the reason for this. Why did the developers choose not to use the whole list of entities as specified in the slot_mappings (‘from_entity’)?
Do you use a different named slot to store the date or using the ‘date’ slot ? In my experience, when i use the equally named slots and entities, the bot still fill the corresponding slots correctly (even if we don’t ask specifically for them).
In the case of different named slot, i’ve only tried it once by getting the ‘last_entity_value’, validate it and set it to the slot manually (since i need to validate that data).
Sorry if i haven’t understood your question correctly but does the bot have problem mapping slots which are not asked explicitly for, or it has trouble with custom slots mapping and doesn’t assign entity to the mapped slot ?
Yes, the entity that i want to map to the date slot is not named ‘date’. That’s the whole point of this topic. It’s not like I have no idea how to solve this, but we’d like to have a nice solution. When we looked into the Rasa code we could not think of a specific reason why the condition I highlighted above is as it is and why its not taking custom slot mappings (‘from_entity’) into account. That question goes to the developers.
Ok, i just found a case where this makes sense. For example when using Duckling we always get an entity named ‘time’, if we want to map this to two different date slots this would horrible fail, if this condition would not be fullfilled. So anytime a ‘time’ entity was found, both date slots would get set with the same date.
Only from context. At that’s not even a shortcoming of the AI, a human would probably have the exact same problem. If you just get a date, you will be able to tell it is actually a date, but you cant decide if its meant to be a start oder end date without any further information. You will decide by the context or ask the other person, what it’s meant to be.
Most simple solution in RASA is to just fill the slot, if its explicitly asked for.
Yes, Book a restaurant require start date and end date.So two ask question was settled in the story.but only one value and the name of it was fixed to “time” returned by rasa.So Is there a way to change “time” to other custom name ?By the way, I used duckling as my entity extractor of date.