The documentation for Fallback Actions states that you can “Add the FallbackPolicy to your policy ensemble” or you can “run it from python”.
Question 1: Can anyone clarify what “adding FallbackPolicy to the policy ensemble” means? It also mentions parameters to adjust thresholds and identify the name of the fallback action. Does that mean you can put them directly into the run command below?
Hi there. To add the Fallback Policy, you need to create an Agent yourself and use that Agent when training the dialog engine. So you need to do a small bit of Python coding, you cannot just use the FallbackPolicy from the command line. What does all this mean? I have a script which wraps common development tasks like training and running. If I call my script with parameter “train_dialog” it calls the method below:
Note line 2 where the agent is initialized. Here you can specify your particular policy pipeline/ensemble that you want to use. I do not use the FallbackPolicy, so it is not present in the policies array parameter. If you want to use the FallbackPolicy, just add it to the policies list like this:
So, you specify your policies during your custom code for dialog training, not in an action. Also, because you have to write a little code to override rasas defaults, you cant use FallbackPolicy straight from the command line, you have to call your custom code.
Hope this helps!
This worked! Thank you very much!! I wrote my own file to train core with (train_core.py) and included the fallback policy. It is now triggering when I type random characters.
I noticed in your script you specify a specific validation_split - if I don’t specify that parameter (or any others like augmentation, etc.), does Rasa just use the default as if I ran training through the command line training (like below)?