How do I customize the affirmation message in the Two-Stage Fallback?

When the Two-Stage Fallback is executed, my bot says the following:

“Did you mean make_reserverations ?”

But I want it to say “Do you want to make a reservation?”

So that it can be more user-friendly. This was very possible in the older versions of Rasa, but I don’t know how to do it in the latest version. Please help!

1 Like

Hi @BrookieHub This you want to be a global message (default fallback) or only for a particular conversation?

1 Like

Global message

@BrookieHub Right, then you can archived with simple update only and try it and tell me its working or not?

@BrookieHub

In config.yml

- name: RulePolicy
    nlu_threshold: 0.4
    core_threshold: 0.4
    fallback_action_name: 'action_default_fallback'

In domain.yml

utter_default:
    - text: “Do you want to make a reservation?”
      buttons:
        - title: Main Menu
          payload: /menu

I guess, this you can archived using action_default_fallback . You just need to update this and then ask out_of_scope question. Please try and let me know.

I have added extra code whilst using button, you can ignore and can use simple text message :slight_smile:

Remember to train the model :stuck_out_tongue:

1 Like

Nope not working

@BrookieHub really? what you had done :thinking: ? did you deleted the older trained models?

1 Like

It works for the ending, but doesn’t work when the initial mistake is made. These are the logs:

Your input ->  fjkd;afjkla                                                                            
? Did you mean 'bot_challenge'? 2: No (/out_of_scope)                                                 
Can you kindly rephrase that please?
Your input ->  fjadl;dfjal;                                                                           
? Did you mean 'residential'? 2: No (/out_of_scope)                                                   
? “Do you want to make a reservation?” (Use arrow keys)                                               
 » 1: Main Menu (/menu)

I think we are very close to finding the solution, I just want it to say “Do you want to make a reservation?” in the first instance.

@BrookieHub It quite strange, did you also mention out_of_scope also in the code? have you deleted the older trained model? please always mention @ and my alias i.e nik202

@BrookieHub You even mentioned this. “Can you kindly rephrase that please?” please delete this story or code and try.

@BrookieHub Model automatically picking for the high confidence value as he thinking that its the response. I hope it make more sense now. I not added anything bot_challenge and out_of_scope in my code.

1 Like

@nik202 Yep I have an intent by the name out_of_scope with little training data, and yes older trained model gone.

- intent: out_of_scope

  examples: |

    - I want to buy a pizza

    - change my password please

I also removed the rephrase one and this is how it is happening:

Your input ->  jfalk;sj;kldfajkl;                                                                     
? Did you mean 'intent_invoice_cancel'? 2: No (/out_of_scope)                                         
Your input ->  jfd;lasjlfk;a                                                                          
? Did you mean 'bot_challenge'? 2: No (/out_of_scope)                                                 
? “Do you want to make a reservation?” (Use arrow keys)                                               
 » 1: Main Menu (/menu)
   Type out your own message.

I also remove bot_challenge and then out_of_scope but it still not working

@BrookieHub In the above screen I can see the out_of_scope and bot_challenge still :frowning: and you stating you had deleted :thinking:

@BrookieHub can you even share with me the config.yml file?

Yep I delete it afterwards and tested.

Here is the chatlog:

Your input ->  jfkld;sajflk;a                                                                         
? Did you mean 'reply_units'? 2: No (/out_of_scope)                                                   
Your input ->  js;dfladjfl;a                                                                          
? Did you mean 'cities'? 2: No (/out_of_scope)                                              
? “Do you want to make a reservation?” (Use arrow keys)                                               
 » 1: Main Menu (/menu)
   Type out your own message...

@BrookieHub increase the

nlu_threshold: 0.4
core_threshold: 0.4

@BrookieHub try investigate whilst using rasa interactive and check which one is getting highest threshold

I increased threshold of both, but still am getting same output

@BrookieHub strange :frowning: me confused now

@BrookieHub do check this video also please Two Stage Fallback Policy | Rasa Chatbot - YouTube

@BrookieHub Its working for me but stranger for your use case, did you tried rasa interactive for more information?

1 Like

Hey @nik202, I was just testing around and your code seemed to work, but not if I made the mistake during the start. It worked perfect in the middle of the conversation, but not during the start. Do you know how I could make it so it also executes during the start?

Hey @nik202 I also checked the video, but it seems to be outdated.