Search code examples
pythonmachine-learningrasarasa-x

Fall back policy is not working with RASA framework


I want to implement two stage fallback policy, and i followed this article

here is config.yml

language: en
pipeline:
  # other policies
  - name: DIETClassifier
    epochs: 100
    entity_recognition: False
  - name: ResponseSelector
    epochs: 100
  - name: FallbackClassifier
    threshold: 0.7
policies:
  - name: TEDPolicy
    max_history: 10
    epochs: 20
  - name: AugmentedMemoizationPolicy
    max_history: 6
  - name: RulePolicy

added rule in rules.yml -

rule: Implementation of the Two-Stage-Fallback 
  steps: - intent: nlu_fallback 
  - action: action_two_stage_fallback 
  - active_loop: action_two_stage_fallback

and response in domain.yml

responses:
  utter_ask_rephrase:
  - text: I'm sorry, I didn't quite understand that. Could you rephrase? 

and on intent confidence goodbye0.23 it is executing goodbye not the fallback policy.

Am i missing something?


Solution

  • I need to mention few params for RulePolicy

    - name: RulePolicy
        core_fallback_threshold: 0.3
        core_fallback_action_name: "action_default_fallback"
        enable_fallback_prediction: True
    

    and now this is working