Predicted next action is always 'action_listen'

Rasa Core version: rasa-core (0.12.4) rasa-nlu (0.13.8)

Python version: Python 3.4.2

Operating system (windows, osx, …): Linux

Issue:

I’m really in the dark here, any clue would be greatly appreciated. Due to our use case, we have to execute an action (utter_ask_any_application_questions) before the user message. For this we’re using:

curl -XPOST $RASA_HOST/conversations/default/execute -d '{"action":"utter_ask_any_application_questions"}' | python -m json.tool

Followed by:

curl -XPOST $RASA_HOST/conversations/default/respond -d '{"query": "No"}' | python -m json.tool

The problem is that rasa_core always predicts ‘action_listen’ despite the fact that the stories enforce ‘utter_application_not_started’ to be predicted.

2019-01-27 20:54:36 DEBUG    rasa_core.tracker_store  - Creating a new tracker for id 'default'.
2019-01-27 20:54:36 DEBUG    rasa_core.processor  - Action 'utter_ask_any_application_questions' ended with events '[]'
2019-01-27 20:54:36 DEBUG    rasa_core.processor  - Bot utterance 'BotUttered(text: Good afternoon! Do you have any questions before an application is fully placed?, data: {
  "buttons": null,
  "elements": null,
  "attachment": null
})'
2019-01-27 20:54:36 DEBUG    rasa_core.tracker_store  - Recreating tracker for id 'default'
127.0.0.1 - - [2019-01-27 20:54:36] "POST /conversations/default/execute HTTP/1.1" 200 962 0.017824
2019-01-27 20:54:48 DEBUG    rasa_core.tracker_store  - Recreating tracker for id 'default'
2019-01-27 20:54:48 DEBUG    rasa_core.processor  - Received user message 'No' with intent '{'name': 'negate', 'confidence': 0.9707666635513306}' and entities '[]'
2019-01-27 20:54:48 DEBUG    rasa_core.processor  - Logged UserUtterance - tracker now has 4 events
2019-01-27 20:54:48 DEBUG    rasa_core.processor  - Current slot values: 

2019-01-27 20:54:48 DEBUG    rasa_core.policies.memoization  - Current tracker state [None, None, {}, {'prev_action_listen': 1.0}, {'intent_negate': 1.0, 'prev_utter_ask_any_application_questions': 1.0}]
2019-01-27 20:54:48 DEBUG    rasa_core.policies.memoization  - There is no memorised next action
2019-01-27 20:54:48 DEBUG    rasa_core.policies.ensemble  - Predicted next action using policy_0_KerasPolicy
2019-01-27 20:54:48 DEBUG    rasa_core.processor  - Predicted next action 'action_listen' with prob 0.41.
2019-01-27 20:54:48 DEBUG    rasa_core.processor  - Action 'action_listen' ended with events '[]'
127.0.0.1 - - [2019-01-27 20:54:48] "POST /conversations/default/respond HTTP/1.1" 200 110 0.205414
2019-01-27 20:54:53 DEBUG    rasa_core.tracker_store  - Recreating tracker for id 'default'
127.0.0.1 - - [2019-01-27 20:54:53] "GET /conversations/default/tracker HTTP/1.1" 200 2488 0.005451

Tracker

{
    "active_form": {},
    "events": [
        {
            "confidence": null,
            "event": "action",
            "name": "action_listen",
            "policy": null,
            "timestamp": 1548651276.5443683
        },
        {
            "confidence": null,
            "event": "action",
            "name": "utter_ask_any_application_questions",
            "policy": null,
            "timestamp": 1548651276.5469334
        },
        {
            "data": {
                "attachment": null,
                "buttons": null,
                "elements": null
            },
            "event": "bot",
            "text": "Good afternoon! Do you have any questions before an application is fully placed?",
            "timestamp": 1548651276.5469916
        },
        {
            "event": "user",
            "input_channel": null,
            "parse_data": {
                "entities": [],
                "intent": {
                    "confidence": 0.9707666635513306,
                    "name": "negate"
                },
                "intent_ranking": [
                    {
                        "confidence": 0.9707666635513306,
                        "name": "negate"
                    },
                    {
                        "confidence": 0.22321242094039917,
                        "name": "smalltalk.agent.be_clever"
                    },
                    {
                        "confidence": 0.18693968653678894,
                        "name": "application.not_started"
                    },
                    {
                        "confidence": 0.18417797982692719,
                        "name": "smalltalk.agent.boring"
                    },
                    {
                        "confidence": 0.18182358145713806,
                        "name": "thank_you"
                    },
                    {
                        "confidence": 0.16652372479438782,
                        "name": "smalltalk.agent.fired"
                    },
                    {
                        "confidence": 0.1490759551525116,
                        "name": "smalltalk.agent.boss"
                    },
                    {
                        "confidence": 0.14218087494373322,
                        "name": "smalltalk.agent.annoying"
                    },
                    {
                        "confidence": 0.14025363326072693,
                        "name": "smalltalk.agent.happy"
                    },
                    {
                        "confidence": 0.13327369093894958,
                        "name": "issue.application.submit"
                    }
                ],
                "text": "No"
            },
            "text": "No",
            "timestamp": 1548651288.6638656
        },
        {
            "confidence": 0.4063744386027321,
            "event": "action",
            "name": "action_listen",
            "policy": "policy_0_KerasPolicy",
            "timestamp": 1548651288.8072796
        }
    ],
    "followup_action": null,
    "latest_action_name": "action_listen",
    "latest_event_time": 1548651288.8072796,
    "latest_input_channel": null,
    "latest_message": {
        "entities": [],
        "intent": {
            "confidence": 0.9707666635513306,
            "name": "negate"
        },
        "intent_ranking": [
            {
                "confidence": 0.9707666635513306,
                "name": "negate"
            },
            {
                "confidence": 0.22321242094039917,
                "name": "smalltalk.agent.be_clever"
            },
            {
                "confidence": 0.18693968653678894,
                "name": "application.not_started"
            },
            {
                "confidence": 0.18417797982692719,
                "name": "smalltalk.agent.boring"
            },
            {
                "confidence": 0.18182358145713806,
                "name": "thank_you"
            },
            {
                "confidence": 0.16652372479438782,
                "name": "smalltalk.agent.fired"
            },
            {
                "confidence": 0.1490759551525116,
                "name": "smalltalk.agent.boss"
            },
            {
                "confidence": 0.14218087494373322,
                "name": "smalltalk.agent.annoying"
            },
            {
                "confidence": 0.14025363326072693,
                "name": "smalltalk.agent.happy"
            },
            {
                "confidence": 0.13327369093894958,
                "name": "issue.application.submit"
            }
        ],
        "text": "No"
    },
    "paused": false,
    "sender_id": "default",
    "slots": {}
}

stories

## greeting
* greeting
  - utter_ask_any_application_questions
    
## Generated Story 5444380226736938167
* greeting
  - utter_ask_any_application_questions
* negate
  - utter_application_not_started
    
## Story 1390588317510348367
  - utter_ask_any_application_questions
* negate
  - utter_application_not_started
    
## Story 1390588317510348367
  - action_listen
  - utter_ask_any_application_questions
* negate
  - utter_application_not_started
    
## Story 1390588317510348367
* negate
  - utter_application_not_started
    
## thank_you
* thank_you
  - utter_youarewelcome

Content of domain file (if used & relevant):

intents:
 - start
 - greeting
 - negate
 - thank_you

templates:
  utter_greet:
    - Hello!
  utter_ask_any_application_questions:
    - "Good afternoon! Do you have any questions before an application is fully placed?"  
  utter_fallback_to_agent:
    - I've sent your status request to a lending specialist who will get back to you. 
  utter_youarewelcome:
    - You're welcome! 
  utter_application_not_started:
    - Ok, would you like any help filling out an application? We have lending specialists available to help make it easy for you. Just give us a call us at 1234567890. Have a great day!
   
actions:
  - utter_greet
  - utter_ask_any_application_questions
  - utter_application_not_started
  - utter_fallback_to_agent
  - utter_youarewelcome
1 Like

Hello, wondering if anyone might have any clues as to what might I be doing wrong to help point me in the right direction?

Thank you

@joseariel think you need to generate more stories.Add more stories and try to include multiple paths in your stories the problem should go away.

I have the same problem too. Could you explain why generating more stories will solve the problem?

My problem is that the prediction is correct in the first few rounds yet becomes action_listen afterwards.

The memorization policty starts to complain

There is no memorised next action

This is the policy that I use, which already incdudes Augmented Memorization Policy.

policies:

  • name: KerasPolicy epochs: 100 max_history: 5
  • name: AugmentedMemoizationPolicy max_history: 2
  • name: FormPolicy
  • name: MappingPolicy

I’m having the same issue, similar as to how @psfr937 describes it: prediction is correct in the first round, but stops working afterwards.

I wonder, why the similar problem does not happen to the Mood Bot (init example from rasa). With it you can iterate the same story again and again.

Would appreciate some ideas.

1 Like

Try setting AugmentedMemoizationPolicy max_history: 0 …That should make it follow story strictly…

1 Like

Hi, Did anyone solve this?

Following up here as I have tested this using MemoizationPolicy as the only policy and max_history: 0, and it is not working for a basic test case.

The behavior is as described above, it generally gets the first round correct, but stops working within a couple rounds.

I say generally, bc I also have a documented case where it misses the 1st round after a clean restart, with absolutely no changes made. In testing it also consistently correctly predicts the 1st 2 rounds, and then for the 3rd round returns “There is no memorised next action.”

My policies.yml file is literally:

policies:
  - name: MemoizationPolicy
    max_history: 0

My main question is why the behavior would seem to be so bad with Memoization history literally set to 0. (I also tried 1 for this value, just for testing, with no improvement.)

Hello! Did anyone manage to find a solution? Same problem.

Is there any development regarding this error. It is continuously coming up and ask for user input again and again.

1 Like

Anyone found a solution to this problem?

Any solution for the above problem. What are policies to set and how to determine the max_history. Any help would really be appreciated.

Hi, i’m facing the same issue, Did anybody find a solution? Thanks in advance.