Hi,
We have following RASA Forms documentation (link), and several relevant forum discussions, in order to ramp-up a simple for which ask the user for his gender, age, weight and height.
For that end, we’ve defined 4 corresponding slots, entities and responses in the domain file:
slots:
gender:
type: unfeaturized
auto_fill: false
age:
type: unfeaturized
auto_fill: false
weight:
type: unfeaturized
auto_fill: false
height:
type: unfeaturized
auto_fill: false
requested_slot:
type: unfeaturized
entities:
- gender
- age
- weight
- height
responses:
utter_ask_gender:
- buttons:
- payload: '/inform{"gender": "male"}'
title: זכר
- payload: '/inform{"gender": "female"}'
title: נקבה
text: are you a male or a female?
utter_ask_age:
- text: how old are your?
utter_ask_weight:
- text: what is your weight?
utter_ask_height:
- text: what is your height?
We also came up with corresponding NLU intents:
## intent:request_profile_info
- I want to provide my profile details
- Do you know who am I
## intent:slot_getter_gender
- [male](gender)
- [female](gender)
## intent:slot_getter_age
- [10](age)
- [37](age)
- [5](age)
- [75](age)
- [18](age)
- [38](age)
## intent:slot_getter_weight
- [23](weight)
- [74](weight)
- [87](weight)
- [57](weight)
- [62](weight)
## intent:slot_getter_height
- [124](height)
- [175](height)
- [188](height)
- [158](height)
- [163](height)
And with a corresponding NLU story:
## user information
* request_profile_info
- profile_form
- form{"name": "profile_form"}
- form{"name": null}
Finally, we’ve added a name: “FormPolicy” policy in the configurations yaml, and implemented the action form class:
class ProfileForm(FormAction):
""" Profile custom form action"""
def name(self) -> Text:
"""Unique identifier of the form"""
return "profile_form"
@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""
return ["gender", "age", "weight", "height"]
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
""" Define what the form has to do after all required slots are filled"""
# utter submit template
dispatcher.utter_message(text="we got it all, thanks!")
return []
Now the problem is that the intents are not being detected correctly.
For example, we were expecting RASA to “know” that the a slot_getter_age intent will be followed an utter_ask_age question. Unfortunately, that’s not the case, and wrong intents detected.
Can you please guide us how to make it right? Have we did something wrong in the above implementation?
Thanks ahead, Newt Team