Help needed! Issue with dererministic policies and payloads

I have an issue with Rasa deterministic policies and payloads. I am bulinding a simple (and stupid) deterministic bot that tries to guess your job based on few questions. Questions are answered only by buttons and checkboxes, so there is no natural language processing and I’m using only the following policies:

  - name: FormPolicy
  - name: MemoizationPolicy
  - name: MappingPolicy

I have a question with a button, then one with a checkbox, and then one with a button again. Everything works good until I come to the final button. Then, when it is selected, the conversation just stops, even though I see in the log that the right payload was uttered. I tried moving logic from to stories and to domain, tried using checkpoints, but nothing made the conversation continue.

One thing that worked was including KerasPolicy in the configuration file. Then, the conversation contiued, but after this, I faced all kinds of other issues. I will skip them for now as I belive fundamentally, there sould not be a need to include KerasPolicy in a deterministic bot and there should be another solution to changig payloads.

Can somebody help?

I have the following story:

## dialog beginning
* disclaimer
  - utter_disclaimer
  - utter_question_1
> check_question_1

## Developer 
> check_question_1
* button_Java 
## data scientist 
> check_question_1
* button_R
## checkboxes 
> check_question_1
* button_python  
  - utter_question_2
  - question_2_form
  - form{"name": "question_2_form"}

 ## happy chatbot path
* button_yes 
  - utter_happy_chatbot_dev

## sad chatbot path 
* button_no
  - utter_sad_chatbot_dev

There is a FormAction assosiated with question_2_form with the folloging logic:

        if tracker.get_slot("tensorflow") == 1:
            dispatcher.utter_template("utter_ml_engineer", tracker)
        if tracker.get_slot("git") == 1:
            dispatcher.utter_template("utter_python_dev", tracker)
        if tracker.get_slot("rasa") == 1:
            dispatcher.utter_template(template="utter_question_happy", tracker=tracker)

where utter_question_happy looks like this:

    - text: >-
        Are you happy?
        - title: 'yes'
          payload: button_yes
        - title: 'no'
          payload: button_no


Without using Keras Policy, when the last payload was given, what was the action predicted by Rasa core and using which policy ? you can check that by runing with debug flag. Most likely the last prediction is action_listen using Memoization.

If it is memoization, it could be linked to max_history which by default is 3. You can try to increase it. Also you can use the Mapping Policy with a trigger for your last intent/payload for the action you want

1 Like

Thank you, @souvikg10. Increasing max_history did help with continuing the conversation, but still the right message was not shown. Adding triggers did solve that.

Not sure you would need rasa core, if you have a deterministic path though. The advantage of core comes with the ‘getting out of conversation card’ when the user unwittingly goes away from the flow. You should use one of the probablistic policies to manage that along with Fallback Policy. if it is simply deterministic then use if-else statements. that is good enough. Rasa NLU is useful either way.

Thanks. This was just a pre-taken decisison that I have to use Rasa. I have problem with a free-text forms. When you enter a free text, let’s say the word “assure”, Rasa take’s it not only as a slot value, that is filled, but also as an intent. So now you I have an intent “assure”, which is not listed in any of my stories, so the stories and ithe memoization break and the bot does not continue after some point. Here it is a part of the log:

2019-08-13 15:27:00 DEBUG    rasa.core.policies.memoization  - There is a memorised next action '842'
2019-08-13 15:27:00 DEBUG    rasa.core.policies.form_policy  - There is an active form 'initial_question_form'
2019-08-13 15:27:00 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_2_FormPolicy
2019-08-13 15:27:00 DEBUG    rasa.core.processor  - Predicted next action 'initial_question_form' with confidence 1.00.
2019-08-13 15:27:00 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'initial_question_form'.
2019-08-13 15:27:01 DEBUG    rasa.core.processor  - Action 'initial_question_form' ended with events '['SlotSet(key: enquiry, value: /assure)', 'AgentUttered(text: bot_lookup, data: null)', 'Form(None)', 'SlotSet(key: requested_slot, value: None)']'

2019-08-13 15:27:01 DEBUG    rasa.core.policies.mapping_policy  - There is no mapped action for the predicted intent, 'assure'.

Is there a way to make Rasa not remember “assure” as an intent?