I have built a form based bot which captures information for an online clothing business. Among other things it asks what product, fabric and colour the user is interested in. I also need to capture the gender as “a blue jacket” could be for a man or a woman. Of course I can add “gender” to my form’s required_slots. Now assume the user tells the bot she is looking for “a white dress”. It doesn’t really make sense to ask “is this for a man or a woman?”.
What I’m looking for is a way to set a form slot based on another slot. In this case when the user enters the product I would use rules or ML classification to set the gender slot as male, female or None. If None I would expect the bot to ask the user to clarify the gender.
I’m thinking one approach could be to use the validate_product method on the form to return not only the product text but also the gender. It seems like a bit of a hack.
Is there a better way to do this?
Many thanks