Hi everybody! I am porting AWS Alexa-based voice bot to Rasa and I am struggling with how to translate concept of slots and slot types to Rasa properly. I apologize in advance if this post feels blunt but I am really confused here .
In Alexa, the interaction model (nlu+domain in Rasa) is quite simple:
- user utterance maps to intent (the same way as in Rasa)
- utterance may contain slots - or more precisely values that are extracted and stored to slots
- each slot is of given type - either built-in (number, duckling-style, etc.) or custom - mostly enumerated values
This is a concept where slot is akin to variable in programming and slot type is, well, its type and every developer understands this right away. It also naturally allows to have multiple slots of the same type in single utterance - you just extract them into different slots.
Now I am wondering how to translate this model correctly to Rasa. The straightforward way is that extracted slots become entities and if there is a slot with the same name, it is filled with the extracted value.
But this looks severely limiting - consider e.g. banking application where there are plenty of amounts and currencies in different utterances and contexts, e.g. as payment order, transaction, debt or interest amount and you must never mix and match them. Yet that is exactly what Rasa forces me to do because there is the only single “currency” entity/slot that gets filled in every utterance regardless of context and meaning. The problem becomes painfully obvious when you have to extract two instances of the same entity in the same utterance - hence you need entity roles - a concept that seems totally redundant to me. Why can’t I fill two different slots instead of roles?
From the side of slots: slots have types, I understand that, but:
- Slot type is not named and reusable - when I want to use the same set of enumerated values for two slots I have to repeat them and keep them in sync
- Entities have sort of “type” too, given by regex, lookup table, or the like. But within implicit “entity to slot with the same name” mapping, slot and entity type are either redundant - one of them would do - or are in conflict which leads to hard-to-find errors in entity extraction.
As with previous banking example if entity serves as slot type, none of these problems would exist.
Am I getting something wrong? Or missing something crucial in Rasa bot setup? I also found this blog offering tricky ways how to map entity+role to slot so I got the feeling it is indeed an issue.
Any useful advice will be greatly appreciated :-).