rasa.core.policies.two_stage_fallback
TwoStageFallbackPolicy Objects
This policy handles low NLU confidence in multiple stages.
If a NLU prediction has a low confidence score, the user is asked to affirm whether they really had this intent. If they affirm, the story continues as if the intent was classified with high confidence from the beginning. If they deny, the user is asked to rephrase his intent. If the classification for the rephrased intent was confident, the story continues as if the user had this intent from the beginning. If the rephrased intent was not classified with high confidence, the user is asked to affirm the classified intent. If the user affirm the intent, the story continues as if the user had this intent from the beginning. If the user denies, an ultimate fallback action is triggered (e.g. a hand-off to a human).
__init__
Create a new Two-stage Fallback policy.
Arguments:
priority
- The fallback policy priority.nlu_threshold
- minimum threshold for NLU confidence. If intent prediction confidence is lower than this, predict fallback action with confidence 1.0.ambiguity_threshold
- threshold for minimum difference between confidences of the top two predictionscore_threshold
- if NLU confidence threshold is met, predict fallback action with confidencecore_threshold
. If this is the highest confidence in the ensemble, the fallback action will be executed.fallback_core_action_name
- This action is executed if the Core threshold is not met.fallback_nlu_action_name
- This action is executed if the user denies the recognised intent for the second time.deny_suggestion_intent_name
- The name of the intent which is used to detect that the user denies the suggested intents.
predict_action_probabilities
Predicts the next action if NLU confidence is low.