Rasa action not following stories

HI

I am new to rasa and i built a chatbot using rasa but some times my model is not following stories i have written instead it is executing other actions.

EX:

story

  • access_eoi
  • action_login
  • slot{“value” : “0”}
  • action_eoi_msg
  • utter_grpyn
  • no
  • utter_state
  • statekey{“state”:“CA”}
  • utter_key
  • action_state_msg
  • utter_ans
  • yes
  • utter_any
  • no
  • action_reset_slot
  • utter_rate

Problem1: This is the story i written for CA similarly i have written for other states also here this story should start when ever user gives eoi as input but it is also executing when user gives CA (statekey) as input which is in the middle of the flow.Can you please let me know what to do to improve accuracy of my model.

LOG: 2019-06-30 09:26:14 DEBUG rasa.core.policies.memoization - There is no memorised next action

2019-06-30 09:26:14 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘statekey’.

2019-06-30 09:26:14 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.5).

2019-06-30 09:26:14 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_KerasPolicy

2019-06-30 09:26:14 DEBUG rasa.core.processor - Predicted next action ‘action_listen’ with confidence 1.00.

2019-06-30 09:26:14 DEBUG rasa.core.processor - Action ‘action_listen’ ended with events ‘

2019-06-30 09:26:14 DEBUG rasa.core.agent - Deleted lock for conversation ‘ccf0affe-9ae2-450b-9294-4e893291f2b4’ (unused)

2019-06-30 09:26:31 DEBUG rasa.core.agent - Created a new lock for conversation ‘2904f614-fb7d-4146-b64d-956c4e54ea3b’

2019-06-30 09:26:31 DEBUG rasa.core.tracker_store - Creating a new tracker for id ‘2904f614-fb7d-4146-b64d-956c4e54ea3b’.

2019-06-30 09:26:31 DEBUG rasa.core.processor - Received user message ‘NY’ with intent ‘{‘name’: ‘statekey’, ‘confidence’: 0.9620376825332642}’ and entities ‘[{‘start’: 0, ‘end’: 2, ‘value’: ‘NY’, ‘entity’: ‘state’, ‘confidence’: 0.9743952055949169, ‘extractor’: ‘CRFEntityExtractor’, ‘processors’: [‘EntitySynonymMapper’]}]’

2019-06-30 09:26:31 DEBUG rasa.core.processor - Current slot values:

    gp_no: None

    id: None

    state: NY

    value: None

2019-06-30 09:26:31 DEBUG rasa.core.processor - Logged UserUtterance - tracker now has 3 events

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, None, {}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0, ‘prev_action_listen’: 1.0}]

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - There is no memorised next action

2019-06-30 09:26:31 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.5).

2019-06-30 09:26:31 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_KerasPolicy

2019-06-30 09:26:31 DEBUG rasa.core.processor - Predicted next action ‘utter_key’ with confidence 0.59.

2019-06-30 09:26:31 DEBUG rasa.core.processor - Action ‘utter_key’ ended with events ‘[‘BotUttered(text: Welcome to NY., data: {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, metadata: {})’]’

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - Current tracker state [None, None, {}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0, ‘prev_action_listen’: 1.0}, {‘slot_state_0’: 1.0, ‘prev_utter_key’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0}]

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - There is no memorised next action

2019-06-30 09:26:31 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘statekey’.

2019-06-30 09:26:31 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.5).

2019-06-30 09:26:31 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_KerasPolicy

2019-06-30 09:26:31 DEBUG rasa.core.processor - Predicted next action ‘action_state_msg’ with confidence 0.85.

2019-06-30 09:26:31 DEBUG rasa.core.actions.action - Calling action endpoint to run action ‘action_state_msg’.

2019-06-30 09:26:31 DEBUG rasa.core.processor - Action ‘action_state_msg’ ended with events ‘[‘BotUttered(text: You can use the Evidence of Insurability link to access the brand specific form , data: {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, metadata: {})’]’

2019-06-30 09:26:31 DEBUG rasa.core.processor - Current slot values:

    gp_no: None

    id: None

    state: NY

    value: None

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - Current tracker state [None, {}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0, ‘prev_action_listen’: 1.0}, {‘slot_state_0’: 1.0, ‘prev_utter_key’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘prev_action_state_msg’: 1.0, ‘intent_statekey’: 1.0}]

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - There is no memorised next action

2019-06-30 09:26:31 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘statekey’.

2019-06-30 09:26:31 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.5).

2019-06-30 09:26:31 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_KerasPolicy

2019-06-30 09:26:31 DEBUG rasa.core.processor - Predicted next action ‘utter_ans’ with confidence 0.99.

2019-06-30 09:26:31 DEBUG rasa.core.processor - Action ‘utter_ans’ ended with events ‘[‘BotUttered(text: Did that answer your question?, data: {“elements”: null, “quick_replies”: null, “buttons”: null, “attachment”: null, “image”: null, “custom”: null}, metadata: {})’]’

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - Current tracker state [{}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0, ‘prev_action_listen’: 1.0}, {‘slot_state_0’: 1.0, ‘prev_utter_key’: 1.0, ‘entity_state’: 1.0, ‘intent_statekey’: 1.0}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘prev_action_state_msg’: 1.0, ‘intent_statekey’: 1.0}, {‘slot_state_0’: 1.0, ‘entity_state’: 1.0, ‘prev_utter_ans’: 1.0, ‘intent_statekey’: 1.0}]

2019-06-30 09:26:31 DEBUG rasa.core.policies.memoization - There is no memorised next action

2019-06-30 09:26:31 DEBUG rasa.core.policies.mapping_policy - There is no mapped action for the predicted intent, ‘statekey’.

2019-06-30 09:26:31 DEBUG rasa.core.policies.fallback - NLU confidence threshold met, confidence of fallback action set to core threshold (0.5).

2019-06-30 09:26:31 DEBUG rasa.core.policies.ensemble - Predicted next action using policy_1_KerasPolicy

2019-06-30 09:26:31 DEBUG rasa.core.processor - Predicted next action ‘action_listen’ with confidence 1.00.

2019-06-30 09:26:31 DEBUG rasa.core.processor - Action ‘action_listen’ ended with events ‘

2019-06-30 09:26:31 DEBUG rasa.core.agent - Deleted lock for conversation ‘2904f614-fb7d-4146-b64d-956c4e54ea3b’ (unused)

Problem2:

we are setting state code by using actions.py but some times we may not have state code( group not found) in that case we are setting State to false so when ever if user enters wrong group number st-2 should execute but insted of this st-1 story is getting executed by ignoring slot and - action_state_msg generally it should execute when state is set to KY but it is also executing when state is set to false.

Executing story(st-1)

  • gp_no
  • action_get_gpno
  • slot{“state” : “KY”}
  • action_state_msg
  • utter_ans
  • yes
  • utter_any
  • no
  • action_reset_slot
  • utter_rate

Story that should execute(st-2)

  • gp_no
  • action_get_gpno
  • slot{“state” : “False”}
  • utter_wrong
  • utter_grpyn
  • yes
  • action_reset_slot
  • utter_gpr

Please let me know how to overcome these issues to make better predication’s.

ALL files related to my project are attached.action.txt (4.7 KB) config.txt (427 Bytes) domain.txt (1.6 KB) endpoint.txt (78 Bytes) nlu.txt (4.1 KB) RASA.txt (3.8 KB) story.txt (10.4 KB)

Thanks&Regards,

Surya.

Can any one please solve my problem

For the first problem you should write stories that start at “CA”, if the bot has no examples that are similar it will have to somehow react based on the examples it did see. The second issue might be addressed by not setting the slot if it is false. Text slots in stories only depend on whether or not they are set at all, not on the value to which they are set. Alternatively you can use categorical slots which might be more suited to your situation where it seems the possible values of the slot are predetermined.

Thanks for your response i cannot write stories starting with CA because i have to check weather if user is login or not then only i can go for State (CA) but my problem is when ever i type CA as user message it is going to statekey (intent for states) which is in the middle of the flow without checking login or not i am not able to understand why it is behaving like this

for second case if i change it from text to categorical will it behave as expected.

You could write a story in which whatever needs to happen before entering statekey information hasn’t yet. In this story you could then make the bot perform the required actions and then return to the happy path.