Hi @Jmg007,
The only thing I still don’t quite get is the difference between entities and slots.
You have to imagine those two terms separated from each other. An entity can be seen as an object with semantic relevance, e.g. for the task Named Entity Recognition. Popular entities are e.g. PERSON, LOCATION, NUMBER - objects that we often want to extract out of text.
A slot is something our bot should fill - primarily it doesn’t matter with which kind of information. Let’s say you are for the first time at a local dentist - usually you have to fill out a form with personal information about yourself. Consider everything to fill out as a slot similar to the one we are talking about - with the difference that our slot should be filled automatically.
Now Rasa simply offers the possibility to fill a slot with the value of any recognized entity. Imagine this example:
Our bot has only one single task: He should fill a slot called fullname.
Now the setup is simple: We create a Form, define one slot and the following mapping:
"fullname": self.from_text()
If the bot asks “Please give me your fullname” you have many possibilities to respond. A few samples:
- Peter Parker
- Gandalf the Grey
- Julian
- Shitstorm
- Blink182
Out of this perspective, the slot would even be filled with the value “Shitstorm” because noone determines how to properly validate the value, e.g. to not being a proper name. Thank god, Rasa provided some additional methods for this one: Why don’t we use a mechanism that already exists for this task? leading to:
"fullname": self.from_entity(entity="PERSON")
This would tell the Bot to fill the slot exclusively with a value that corresponds to the entity PERSON, e.g. “Peter Parker” - assumed that our NLU-Core extracted the entity PERSON properly.
Of course this mechanisms are error-prone such that it is always a good idea to use the validator-methods to inject some additional validation but I think you got it now.
Did this help?
Regards
Julian