Question for compressing conditional slot utterance custom actions into a single action/class?


Putting this here for anyone who understands the underlying ML Rasa runs on and whether this is a good idea.

I have a chat bot that uses a lot of conditional slot utterances based on the user’s profile (i.e. “if a user is > 30 years old, execute these specific utterances for users over 30”), which are currently encoded as separate custom actions that run inside of a story. This works fine, but I’m getting to the point where I think I need to house all of these conditional utterances in a single class for easier maintenance.

My thought is to have one action check_slots, where I have all of the conditions encoded in a list of dicts, which will queue up the appropriate actions based on specified criteria. Encoding those conditions I’m not super worried about, but I’m guessing that a side-effect of this is that I’ll be replacing wherever unique conditional slot utterances occur with just check_slots, which might weigh that action more heavily during prediction time.

Has anyone done something similar and successfully avoided a frequently recurring action (like check_slots) from being the highest confidence action during prediction time?

I think the best approach here would be to create a custom slot, which featurization would depend on your conditions, then you can simply write the stories (or better our new rule snippets in 2.0alpha version) with - slot{"age": "31"} etc