Predicting the next action

Rasa version: 1.3.9

Python version: 3.7


My first question is for the following story:

happy path

  • greet
    • utter_greet
  • mood_great
    • utter_happy

should users only be able to trigger the utter_happy action if they have first triggered the utter_greet action?

My second question is I am trying to use the Rasa apis to predict what the next action is in a story. I’m using the following API’s in order to try and achieve this:

Parse the message using the Rasa model (message hello to trigger utter_greet)

Add the message to a tracker

Predict the next action

However, the response from the predict next action API does seem to predict the next action, which I would expect to be utter_happy, but it is instead utter_greet.

Am I using the api’s incorrectly? Or have I misunderstood their purpose?

NOTE: I can provide more detail and examples of my api requests if required.

Hello @liz, thank you for your question.

The next action prediction is handled by Rasa Core, which can be configured to use various policies. If you use a machine learning policy, like the new default TED policy, or the former default Keras policy (an LSTM), then Rasa Core learns to make such predictions from the stories that you provide and it should be able to generalise to new situations if you provide enough stories. Thus, your stories never restrict the user input, they just provide guidance for the Rasa Core policy model.

Did you train your model with the latest stage of your training data before you used the API? Also, note that you can just use rasa shell to talk to your bot, or rasa x to share it. See Getting Started with Rasa.