Rule Policy No Reaction

Hello everyone! I’m working on a chatbot that help the user make an order and ask for ratings. And I’m working on the experiment that the user will go through the process again if not satisfied. The following is the story.

  • story: story_1deny
    steps:
  • intent: greet
  • action: utter_greet_and_menu
  • intent: make_order
  • action: utter_ask_rate
  • intent: deny
  • action: loop_action
  • action: utter_greet_and_menu
  • action: second_apology_action
  • intent: deny
  • action: loop_action
  • action: utter_greet_and_menu
  • action: second_apology_action
  • intent: affirm
  • action: end_remarks_action

And here is my policies:

policies:

  • name: RulePolicy
    core_fallback_threshold: 0.1
    core_fallback_action_name: action_default_fallback
    enable_fallback_prediction: false
    restrict_rules: true
    check_for_contradictions: true
  • name: MemoizationPolicy
    max_history: 9
  • name: TEDPolicy
    max_history: 5
    epochs: 300
    constrain_similarities: true

And the Rules to handle some bot challenge:

  • rule: Rule1
    steps:
  • intent: challenge1
  • action: utter_B1 wait_for_user_input: false
  • rule: Rule2
    steps:
  • intent: challenge2
  • action: utter_B2
    wait_for_user_input: false
  • rule: Response to invalid input anytime the user makes invalid input
    steps:
  • intent: nlu_fallback
  • action: utter_C
    wait_for_user_input: false

When I’m testing the bot, it runs smoothly in the first “loop”(the first part of the story). But when it comes to the second part, the bot will not response to the intents “challenge1”, “challenge2” in the rules.

And here is the loop_action:

class ActionLoop(Action): def name(self) → Text: return “loop_action”

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    fail_times = tracker.get_slot('fail_times')

    if(fail_times < 2):
        return[SlotSet('fail_times', fail_times+1), FollowupAction('utter_greet_and_menu') ]
    else:
        dispatcher.utter_message(text='.')
        return [FollowupAction('end_remarks_action')]

So I’m wondering what’s the reason? Is the Rule Policy did not predict the correct action? Or there are some other priority settings? Could you help me out? Thanks!