MappingPolicy doesn't get triggered

I am trying to use MappingPolicy to deactivate an active form in Rasa version 1.1.8. In the conversation with my chatbot, a user gets buttons with a payload for it.

In the payload of one button, I have /deactivate_intent. In the domain.yml, I have mapped this intent as follows:

- deactivate_intent: {triggers: action_deactivate_form}

I also have put MappingPolicy in my config.yml as follows:

  - name: MemoizationPolicy
    max_history: 3
  - name: KerasPolicy
    - name: MaxHistoryTrackerFeaturizer
      max_history: 3
        - name: BinarySingleStateFeaturizer
  - name: MappingPolicy
  - name: FormPolicy
  - name: TwoStageFallbackPolicy
    nlu_threshold: 0.65
    core_threshold: 0.35
    fallback_nlu_action_name: "action_default_fallback"
    fallback_core_action_name: "action_default_ask_affirmation"
    deny_suggestion_intent_name: "out_of_scope" 

Still, Rasa isn’t triggering the mapped action. Instead the active form def_form is getting triggered. Below is the log:

2019-11-05 12:29:41 DEBUG    rasa.core.processor  - Received user message '/deactivate_intent' with intent '{'name': 'deactivate_intent', '
confidence': 1.0}' and entities '[]'
2019-11-05 12:29:41 DEBUG    rasa.core.processor  - Logged UserUtterance - tracker now has 25 events
2019-11-05 12:29:41 DEBUG    rasa.core.policies.memoization  - Current tracker state [{'prev_action_abc': 1.0, 'intent_ask_def': 1.0
}, {'prev_action_def': 1.0, 'intent_ask_def': 1.0}, {'intent_ask_def': 1.0, 'prev_action_listen': 1.0}]
2019-11-05 12:29:41 DEBUG    rasa.core.policies.memoization  - There is no memorised next action
2019-11-05 12:29:41 DEBUG    rasa.core.policies.mapping_policy  - There is no mapped action for the predicted intent, 'deactivate_intent'.
2019-11-05 12:29:41 DEBUG    rasa.core.policies.form_policy  - There is an active form 'def_form'
2019-11-05 12:29:41 DEBUG    rasa.core.policies.two_stage_fallback  - NLU confidence threshold met, confidence of fallback action set to core threshold (0.35).
2019-11-05 12:29:41 DEBUG    rasa.core.policies.ensemble  - Predicted next action using policy_1_KerasPolicy
2019-11-05 12:29:41 DEBUG    rasa.core.processor  - Predicted next action 'def_form' with confidence 0.90.
2019-11-05 12:29:41 DEBUG    rasa.core.actions.action  - Calling action endpoint to run action 'def_form'.

This only happens when I run the model in server. In the shell, it is working fine.

@tonysinghmss Are you sure you have the same Rasa version both on server and local shell?

Yes I am sure they are same. I am trying it in my local machine.

Actually I am pushing an action everytime the chat session begins. This action was returning a blank event list. After I returned ActionReverted() in the event list, it seems to work.

But now some of my short stories are not getting recognized and TwoStageFallbackPolicy is getting invoked.

Can you share an example of a conversation that fails and the corresponding story that you have in training data but the prediction fails?

I cannot reproduce this issue right now. I have lowered my nlu_threshold to 0.5 and everything seems to work fine. Maybe the messages were not meeting the threshold at the time.

Is there any way to find the optimal values of nlu and core threshold in Rasa based on the stories and nlu data?