Hi! I’m trying to build a bot which uses a form. In one of the form-slots the bot asks the user for a transportation method. I can successfully extract the correct entity but I want to generalize it.
Example 1:
If the users writes “I will fly”, the bot should recognize the entity “fly” and generalize it to “plane”.
Example 2:
If the users writes “I will ride my bike”, the bot should recognize the entity “bike” and generalize it to “bicycle”.
Okay, I will try this. My current solution is a synonym-table in the action which compare the similarity between the entity and all the synonyms. And the one with the highest string similarity-score will be set as the new entity. But your way looks better, I will get back to you once I have tried this.
I have a follow up question. The thing is i only have the slot ‘travel_mode’, which should be bicycle, car etc. And I’m guessing you are using a slot for plane another one for bicycle. If i decide to do it your way with multiple slots will the assistant not ask a question to first fill the plane slot and then fill the bicycle slot since I’m using a form? Or is their a way around this?
We usually recommend a single inform intent for situations like thsi and there’s also a shortcut method for synonyms that some people prefer over the separate ## synonym:plane approach:
## intent:inform
- i want to travel by [flight](travel_method:plane)
- i will travel by [chopper](travel_method:plane)
- i want to travel by [sports bike](travel_method:bicycle)