Action_deactivate_form not working

I want to work out below story

> * greet
>     - utter_greet
> * fund_transfer
>     - bank_form
>     - form{"name": "bank_form"}
> * stop
>     - utter_ask_continue 
> * deny
>     - action_deactivate_form 
>     - form{"name": null}  

Everything works fine till utter_ask_continue (do you want to continue last action) action. When user say “No” (deny) in response to above , bot does not deactivate the form. Infact it predicts bank_form using FormPolicy.

This is strange. Do you have any other stories that might be conflicting with this one? Can you post the full debug log?

Your input -> hi 2019-06-14 20:15:48 DEBUG rasa_core.tracker_store - Creating a new tracker for id ‘default’. 2019-06-14 20:15:48 DEBUG rasa_core.processor - Received user message ‘hi’ with intent ‘{‘name’: ‘greet’, ‘confidence’: 0.9535133242607117}’ and entities ‘[]’ 2019-06-14 20:15:48 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 2 events 2019-06-14 20:15:48 DEBUG rasa_core.processor - Current slot values: account_details: None account_type: None amount: None authorized_user: None beneficiary: None closing_balance: None customer_id: None date: None opening_balance: None requested_slot: None user_acc_id: None user_beneficiary_id: None user_details: None 2019-06-14 20:15:48 DEBUG rasa_core.policies.memoization - Current tracker state [None, None, None, {}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}] 2019-06-14 20:15:48 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘8’ 2019-06-14 20:15:48 DEBUG rasa_core.policies.form_policy - There is no active form 2019-06-14 20:15:48 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_MemoizationPolicy 2019-06-14 20:15:48 DEBUG rasa_core.processor - Predicted next action ‘utter_greet’ with prob 1.00. 2019-06-14 20:15:48 DEBUG Hi! I am your banking bot. How can I help you? rasa_core.processor - Action ‘utter_greet’ ended with events ‘[]’ 2019-06-14 20:15:48 DEBUG rasa_core.processor - Bot utterance ‘BotUttered(text: Hi! I am your banking bot. How can I help you?, data: { “elements”: null, “buttons”: null, “attachment”: null })’ 2019-06-14 20:15:48 DEBUG rasa_core.policies.memoization - Current tracker state [None, None, {}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}] 2019-06-14 20:15:48 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘15’ 2019-06-14 20:15:48 DEBUG rasa_core.policies.form_policy - There is no active form 2019-06-14 20:15:48 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_MemoizationPolicy 2019-06-14 20:15:48 DEBUG rasa_core.processor - Predicted next action ‘action_login’ with prob 1.00. 2019-06-14 20:15:48 DEBUG rasa_core.actions.action - Calling action endpoint to run action ‘action_login’. 2019-06-14 20:15:55 DEBUG rasa_core.processor - Action ‘action_login’ ended with events ‘[“SlotSet(key: user_details, value: {‘BankName’: ‘BANK’, ‘CustId’: 123, ‘Email’: ‘ABC@abc.com’, ‘Name’: ‘ABC’, ‘Password’: ‘abc@1234’, ‘UID’: 2})”]’ 2019-06-14 20:15:55 DEBUG rasa_core.policies.memoization - Current tracker state [None, {}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘intent_greet’: 1.0, ‘prev_action_login’: 1.0}] 2019-06-14 20:15:55 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘0’ 2019-06-14 20:15:55 DEBUG rasa_core.policies.form_policy - There is no active form 2019-06-14 20:15:55 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_MemoizationPolicy 2019-06-14 20:15:55 DEBUG rasa_core.processor - Predicted next action ‘action_listen’ with prob 1.00. 2019-06-14 20:15:55 DEBUG rasa_core.processor - Action ‘action_listen’ ended with events ‘[]’ 127.0.0.1 - - [2019-06-14 20:15:55] “POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1” 200 214 7.585275 Your input -> fund transfer 2019-06-14 20:16:01 DEBUG rasa_core.tracker_store - Recreating tracker for id ‘default’ 2019-06-14 20:16:01 DEBUG rasa_core.processor - Received user message ‘fund transfer’ with intent ‘{‘name’: ‘fund_transfer’, ‘confidence’: 0.9754638075828552}’ and entities ‘[]’ 2019-06-14 20:16:01 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 8 events 2019-06-14 20:16:01 DEBUG rasa_core.processor - Current slot values: account_details: None account_type: None amount: None authorized_user: None beneficiary: None closing_balance: None customer_id: None date: None opening_balance: None requested_slot: None user_acc_id: None user_beneficiary_id: None user_details: {‘BankName’: ‘BANK’, ‘CustId’: 123, ‘Email’: ‘ABC@abc.com’, ‘Name’: ‘ABC’, ‘Password’: ‘abc@1234’, ‘UID’: 2} 2019-06-14 20:16:01 DEBUG rasa_core.policies.memoization - Current tracker state [{}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘intent_greet’: 1.0, ‘prev_action_login’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘prev_action_listen’: 1.0}] 2019-06-14 20:16:01 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘23’ 2019-06-14 20:16:01 DEBUG rasa_core.policies.form_policy - There is no active form 2019-06-14 20:16:01 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_MemoizationPolicy 2019-06-14 20:16:01 DEBUG rasa_core.processor - Predicted next action ‘bank_form’ with prob 1.00. 2019-06-14 20:16:01 DEBUG rasa_core.actions.action - Calling action endpoint to run action ‘bank_form’. 2019-06-14 20:16:02 Validation failedDEBUG Enter customer_idrasa_core.processor

  • Action ‘bank_form’ ended with events ‘[‘Form(bank_form)’, ‘SlotSet(key: requested_slot, value: customer_id)’]’ 2019-06-14 20:16:02 DEBUG rasa_core.processor - Bot utterance ‘BotUttered(text: Validation failed, data: { “elements”: null, “buttons”: null, “attachment”: null })’ 2019-06-14 20:16:02 DEBUG rasa_core.processor - Bot utterance ‘BotUttered(text: Enter customer_id, data: { “elements”: null, “buttons”: null, “attachment”: null })’ 2019-06-14 20:16:02 DEBUG rasa_core.policies.memoization - Current tracker state [{}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘intent_greet’: 1.0, ‘prev_action_login’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘prev_action_listen’: 1.0}] 2019-06-14 20:16:02 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘23’ 2019-06-14 20:16:02 DEBUG rasa_core.policies.form_policy - There is an active form ‘bank_form’ 2019-06-14 20:16:02 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_3_FormPolicy 2019-06-14 20:16:02 DEBUG rasa_core.processor - Predicted next action ‘action_listen’ with prob 1.00. 2019-06-14 20:16:02 DEBUG rasa_core.processor - Action ‘action_listen’ ended with events ‘[]’ 127.0.0.1 - - [2019-06-14 20:16:02] “POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1” 200 248 1.131638 Your input -> stop 2019-06-14 20:16:13 DEBUG rasa_core.tracker_store - Recreating tracker for id ‘default’ 2019-06-14 20:16:13 DEBUG rasa_core.processor - Received user message ‘stop’ with intent ‘{‘name’: ‘stop’, ‘confidence’: 0.9798009395599365}’ and entities ‘[]’ 2019-06-14 20:16:13 DEBUG rasa_core.processor - Logged UserUtterance - tracker now has 15 events 2019-06-14 20:16:13 DEBUG rasa_core.processor - Current slot values: account_details: None account_type: None amount: None authorized_user: None beneficiary: None closing_balance: None customer_id: None date: None opening_balance: None requested_slot: customer_id user_acc_id: None user_beneficiary_id: None user_details: {‘BankName’: ‘BANK’, ‘CustId’: 123, ‘Email’: ‘ABC@abc.com’, ‘Name’: ‘ABC’, ‘Password’: ‘abc@1234’, ‘UID’: 2} 2019-06-14 20:16:13 DEBUG rasa_core.policies.memoization - Current tracker state [{}, {‘prev_action_listen’: 1.0, ‘intent_greet’: 1.0}, {‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘intent_greet’: 1.0, ‘prev_action_login’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘prev_action_listen’: 1.0}] 2019-06-14 20:16:13 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘23’ 2019-06-14 20:16:13 DEBUG rasa_core.policies.form_policy - There is an active form ‘bank_form’ 2019-06-14 20:16:13 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_3_FormPolicy 2019-06-14 20:16:13 DEBUG rasa_core.processor - Predicted next action ‘bank_form’ with prob 1.00. 2019-06-14 20:16:13 DEBUG rasa_core.actions.action - Calling action endpoint to run action ‘bank_form’. 2019-06-14 20:16:14 DEBUG rasa_core.actions.action - Failed to validate slot customer_id with action bank_form 2019-06-14 20:16:14 DEBUG rasa_core.policies.memoization - Current tracker state [{‘prev_utter_greet’: 1.0, ‘intent_greet’: 1.0}, {‘intent_greet’: 1.0, ‘prev_action_login’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘prev_action_listen’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘active_form_bank_form’: 1.0, ‘prev_bank_form’: 1.0}, {‘active_form_bank_form’: 1.0, ‘prev_action_listen’: 1.0, ‘intent_stop’: 1.0}] 2019-06-14 20:16:14 DEBUG rasa_core.policies.memoization - There is no memorised next action 2019-06-14 20:16:14 DEBUG rasa_core.policies.form_policy - There is an active form ‘bank_form’ 2019-06-14 20:16:14 DEBUG rasa_core.policies.form_policy - There is a memorized tracker state [{‘prev_bank_form’: 1.0}, {‘active_form_bank_form’: 1.0, ‘prev_action_listen’: 1.0, ‘intent_stop’: 1.0}], added FormValidation(False) event 2019-06-14 20:16:14 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_0_KerasPolicy 2019-06-14 20:16:14 DEBUG rasa_core.processor - Predicted next action ‘utter_ask_continue’ with prob 0.58. 2019-06-14 20:16:14 DEBUG Do you want to continue? rasa_core.processor - Action ‘utter_ask_continue’ ended with events ‘[]’ 2019-06-14 20:16:14 DEBUG rasa_core.processor - Bot utterance ‘BotUttered(text: Do you want to continue?, data: { “elements”: null, “buttons”: null, “attachment”: null })’ 2019-06-14 20:16:14 DEBUG rasa_core.policies.memoization - Current tracker state [{‘intent_greet’: 1.0, ‘prev_action_login’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘prev_action_listen’: 1.0}, {‘intent_fund_transfer’: 1.0, ‘active_form_bank_form’: 1.0, ‘prev_bank_form’: 1.0}, {‘active_form_bank_form’: 1.0, ‘prev_action_listen’: 1.0, ‘intent_stop’: 1.0}, {‘active_form_bank_form’: 1.0, ‘intent_stop’: 1.0, ‘prev_utter_ask_continue’: 1.0}] 2019-06-14 20:16:14 DEBUG rasa_core.policies.memoization - There is a memorised next action ‘0’ 2019-06-14 20:16:14 DEBUG rasa_core.policies.form_policy - There is an active form ‘bank_form’ 2019-06-14 20:16:14 DEBUG rasa_core.policies.ensemble - Predicted next action using policy_2_MemoizationPolicy 2019-06-14 20:16:14 DEBUG rasa_core.processor - Predicted next action ‘action_listen’ with prob 1.00. 2019-06-14 20:16:14 DEBUG rasa_core.processor - Action ‘action_listen’ ended with events ‘[]’ 127.0.0.1 - - [2019-06-14 20:16:14] “POST /webhooks/rest/webhook?stream=true&token= HTTP/1.1” 200 192 1.160284 Your input -> no

Kindly review the line where the log says

Predicted next action ‘bank_form’ with prob 1.00.

I will try to make keras policy little more deep(layer). Might be that could help.

Have you managed to resolve the issue ? I have a similar problem , Keras is predicting the form even it has been disabled and is not following the story.

I added one more layer of LSTM (i.e. stacked LSTM ) in keras policy. It somewhat solved the issue for me.

How have you done this, i have the same problem but have not found out how to configure this.

If you use self.from_text() in actions.py, you should write like this: “email”: self.from_text(not_intent = “deny”). If so, when the intent “deny” is detected, it will be not taken as a form object and stop the form. Let me know if this works!

did you resolve this issue?. can you please share solution to resolve this. in my case, deny is detected but action_deactivate_form is not called. instead it is predicting previous entity.