I’m a bit confused as to when “from_text” and “from_entities” must be used.
To give you an idea, I’m creating a custom action for a form that will collect information (e.g. name, date, contact number) from users. In my NLU, I have an intent: inform where I provided examples of user’s answers. The expectation is that users will be providing answers directly (i.e. What’s your name? A: Clare) and not in sentences (My name’s Clare).
In this case, is it better to use “self.from_text” vs self.from_entity"?
If you can guarantee that whatever the user enters is going to be what should end up in the slot, then you should use from_text. Make sure, however, that your assumption is correct - real users rarely behave the way you’d expect.
You can also use both, i.e. from_entity and from_text in that order. In this case, Rasa will try to find the name entity, and if it cannot find it, it’ll take the entire text. It may also be useful to set a not_intent list, in case users don’t reply to your message.
i followed your suggestion, and I have two additional questions.
(1) Turns out that SpaCy is doing better at extracting names of PERSONs in sentences (e.g. last name’s {name_of_PERSON} vs just the name or surname itself (e.g. “Medallo”) even if this is in my NLU training example under intent: inform. Does this mean the from_text in my custom action is not working?
This is how my domain looks like. Should I perhaps add from_text here as well?
(2) are there any projects on github utilizing not_intent ? can’t seem to understand “excluded_intent”.
Yes, I think Rasa predicts action_listen after the user says “Medallo” because it doesn’t recognize the name and the from_text is missing in the domain. It should be something like this:
I don’t know about example projects, but you can add a not_intent item to ensure that the form doesn’t fill a slot from, e.g., the full user text if the user is saying something that doesn’t fit there. For example: