Slot value resets to None

Hi, I have an unfeaturized slot. In the first sentence, the slot value is set, however when the user types the second sentence, the slot value resets to None

Here are the logs

rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.processor  - Received user message '/WELCOME{"language":"FR"}' with intent '{'name': 'WELCOME', 'confidence': 1.0}' and entities '[{'entity': 'language', 'start': 8, 'end': 25, 'value': 'FR'}]'
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 3 events
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.processor  - Current slot values:
rasa-core-fr_1     |    language: FR
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.policies.memoization  - Current tracker state [None, {}, {'entity_language': 1.0, 'prev_action_listen': 1.0, 'intent_WELCOME': 1.0}]
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.policies.ensemble  - Action 'action_listen' was predicted after a user message using policy_2_KerasPolicy. Predicting fallback action: action_default_fallback
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_0_FallbackPolicy
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.processor  - Predicted next action 'action_default_fallback' with prob 1.00.
rasa-core-fr_1     | 2018-10-04 22:16:33 DEBUG    rasa_core.nlg.callback  - Requesting NLG for utter_default from http://template-server:5056/nlg.
rasa-core-fr_1     | 172.22.0.6 - - [2018-10-04 22:16:33] "POST /webhooks/rest/webhook HTTP/1.1" 200 236 0.264871
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.processor  - Received user message 'salut' with intent '{'name': 'hello', 'confidence': 0.9617201028961402}' and entities '[]'
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 8 events
rasa-nlu-fr_1      | 2018-10-04 22:16:54+0000 [-] "172.22.0.11" - - [04/Oct/2018:22:16:54 +0000] "GET /parse?model=nlu_hello_chatbot_v0.0.1&project=hello-chatbot&q=salut HTTP/1.1" 200 361 "-" "python-requests/2.19.1"
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.processor  - Current slot values:
rasa-core-fr_1     |    language: None
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.policies.memoization  - Current tracker state [None, {}, {'intent_hello': 1.0, 'prev_action_listen': 1.0}]
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.policies.memoization  - There is a memorised next action '3'
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_1_MemoizationPolicy
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.processor  - Predicted next action 'utter_hi' with prob 1.00.
rasa-core-fr_1     | 2018-10-04 22:16:54 DEBUG    rasa_core.nlg.callback  - Requesting NLG for utter_hi from http://template-server:5056/nlg.

As you can see the Current Slot value resets to None

It is probably due to the fact that action_default_fallback returns UserUtteranceReverted(), which reverts user’s latest message /WELCOME{"language":"FR"} and all the slots that it sets

Indeed, but if anytime there is a fallback, all slots are reset??

not all, only the ones from the last user message. You can provide your own fallback action if you want to change this behavior

Okay, good to know. :smiley:

I am seeing same issue that

  1. Predicted next action ‘action_default_fallback’
  2. Action ‘action_default_fallback’ ended with events '[<rasa.shared.core.events.UserUtteranceReverted
  3. Some slots are reset

Though I am not able to understand why in my case it is going to fallback.

story

- story: newsletter
  steps:
  - intent: greet
  - action: action_greet
  - action: user_info_form
  - action: action_onboarding_welcome
  - slot_was_set:
    - confirm: true
  - action: action_bot_capability

Output of rasa shell --debug

2021-07-26 10:07:21 DEBUG    rasa.core.actions.forms  - Deactivating the form 'user_info_form'
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Policy prediction ended with events '[<rasa.shared.core.events.DefinePrevUserUtteredFeaturization object at 0x7fe907329f98>]'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Action 'user_info_form' ended with events '[<rasa.shared.core.events.SlotSet object at 0x7fe907332208>, <rasa.shared.core.events.SlotSet object at 0x7fe907339048>, <rasa.shared.core.events.ActiveLoop object at 0x7fe907332320>]'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Current slot values:
        user_type: Parent
        email: None
        user_existing: False
        user_name: kapil
        user_first_name: None
        user_pin: None
        confirm: True
        education_level: None
        education_stream: None
        newsletter_last_sent: None
        newsletter_subscribed: None
        test_user: True
        requested_slot: None
        session_started_metadata: None
2021-07-26 10:07:21 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen | slots: {'test_user': (1.0, 1.0)}
[state 2] user intent: greet | previous action name: action_greet | slots: {'user_existing': (1.0, 0.0), 'test_user': (1.0, 1.0)}
[state 3] user intent: greet | previous action name: user_info_form | slots: {'user_existing': (1.0, 0.0), 'confirm': (1.0, 1.0), 'test_user': (1.0, 1.0)}
2021-07-26 10:07:21 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2021-07-26 10:07:21 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'action_onboarding_welcome' based on user intent.
2021-07-26 10:07:21 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: add_remove_test_user | previous action name: action_listen
[state 2] user intent: add_remove_test_user | previous action name: utter_add_remove_test_user
[state 3] user intent: add_test_user | previous action name: action_listen
[state 4] user intent: add_test_user | previous action name: action_add_test_user | slots: {'test_user': (1.0, 1.0)}
[state 5] user intent: greet | previous action name: action_listen | slots: {'test_user': (1.0, 1.0)}
[state 6] user intent: greet | previous action name: action_greet | slots: {'user_existing': (1.0, 0.0), 'test_user': (1.0, 1.0)}
[state 7] user intent: greet | previous action name: user_info_form | slots: {'user_existing': (1.0, 0.0), 'confirm': (1.0, 1.0), 'test_user': (1.0, 1.0)}
2021-07-26 10:07:21 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2021-07-26 10:07:21 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_TEDPolicy.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Predicted next action 'action_onboarding_welcome' with confidence 0.32.
2021-07-26 10:07:21 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'action_onboarding_welcome'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Action 'action_onboarding_welcome' ended with events '[BotUttered('Welcome Kapil, it's so nice to have you here', {"elements": null, "quick_replies": null, "buttons": null, "attachment": null, "image": null, "custom": null}, {}, 1627274241.73381)]'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Current slot values:
        user_type: Parent
        email: None
        user_existing: False
        user_name: kapil
        user_first_name: None
        user_pin: None
        confirm: True
        education_level: None
        education_stream: None
        newsletter_last_sent: None
        newsletter_subscribed: None
        test_user: True
        requested_slot: None
        session_started_metadata: None
2021-07-26 10:07:21 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 1] user intent: greet | previous action name: action_listen | slots: {'test_user': (1.0, 1.0)}
[state 2] user intent: greet | previous action name: action_greet | slots: {'user_existing': (1.0, 0.0), 'test_user': (1.0, 1.0)}
[state 3] user intent: greet | previous action name: user_info_form | slots: {'user_existing': (1.0, 0.0), 'confirm': (1.0, 1.0), 'test_user': (1.0, 1.0)}
[state 4] user intent: greet | previous action name: action_onboarding_welcome | slots: {'user_existing': (1.0, 0.0), 'confirm': (1.0, 1.0), 'test_user': (1.0, 1.0)}
2021-07-26 10:07:21 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2021-07-26 10:07:21 DEBUG    rasa.core.policies.ted_policy  - TED predicted 'action_bot_capability' based on user intent.
2021-07-26 10:07:21 DEBUG    rasa.core.policies.rule_policy  - Current tracker state:
[state 1] user intent: add_remove_test_user | previous action name: action_listen
[state 2] user intent: add_remove_test_user | previous action name: utter_add_remove_test_user
[state 3] user intent: add_test_user | previous action name: action_listen
[state 4] user intent: add_test_user | previous action name: action_add_test_user | slots: {'test_user': (1.0, 1.0)}
[state 5] user intent: greet | previous action name: action_listen | slots: {'test_user': (1.0, 1.0)}
[state 6] user intent: greet | previous action name: action_greet | slots: {'user_existing': (1.0, 0.0), 'test_user': (1.0, 1.0)}
[state 7] user intent: greet | previous action name: user_info_form | slots: {'user_existing': (1.0, 0.0), 'confirm': (1.0, 1.0), 'test_user': (1.0, 1.0)}
[state 8] user intent: greet | previous action name: action_onboarding_welcome | slots: {'user_existing': (1.0, 0.0), 'confirm': (1.0, 1.0), 'test_user': (1.0, 1.0)}
2021-07-26 10:07:21 DEBUG    rasa.core.policies.rule_policy  - There is no applicable rule.
2021-07-26 10:07:21 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_2_RulePolicy.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Predicted next action 'action_default_fallback' with confidence 0.30.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Policy prediction ended with events '[]'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Action 'action_default_fallback' ended with events '[<rasa.shared.core.events.UserUtteranceReverted object at 0x7fe9073249e8>]'.
2021-07-26 10:07:21 DEBUG    rasa.core.processor  - Current slot values:
        user_type: None
        email: None
        user_existing: None
        user_name: None
        user_first_name: None
        user_pin: None
        confirm: None
        education_level: None
        education_stream: None
        newsletter_last_sent: None
        newsletter_subscribed: None
        test_user: True
        requested_slot: None
        session_started_metadata: None
2021-07-26 10:07:21 DEBUG    rasa.core.policies.memoization  - Current tracker state:
[state 1] previous action name: action_listen | slots: {'test_user': (1.0, 1.0)}

This isn’t an issue. it is an expected behaviour, the fallback will revert the previous uterrance and all slots set by it.

your tracker logs is following the story you have provided but then there are subsequent actions which isn’t mentioned in the example provided

thanks for revert.

I had understood the part that the fallback will revert the previous utterance and all slots set by it.

What I am not clear is why fallback is happening in my case. I see that action_onboarding_welcome is running. In first part of this action, we can see in logs, slots are set. While this action is still ongoing, I don’t know what happens and action fallback is triggered. How do I figure out what is causing fallback action to be triggered?

logs shared in above post are the complete logs shown between when slots were set and fallback action happens. happy to share more logs or anything else which can help understand issue

could you do this using interactive learning?

it is likely that the confidence of predicting this action might be lower than the threshold