Force next two FollowUp actions

Rasa Core version :

0.12.4

Python version :

Python 2.7.6

Operating system (windows, osx, …):

OSX

Issue :

Is it possible force the next two actions, or is there a way to force an action_listen before a forced action?

I am trying to make a quiz, but can’t seem to get the bot to preform the right actions in sequence. The conversations should go sequentially like this,

  1. Bot: Gives a random question.
  2. User: Answers with free text.
  3. Bot: Checks answer and tells user is answer is right or wrong.

Specifically the actions should go in this order

  1. (action_SendQuestion)
  2. (action_listen)
  3. (action_CheckAnswer)

The fact that the user may answer with any free text is confusing the NLU, often does another action other then CheckAnswer. If I force CheckAnswer after the action SendQuestion, the bot skips action_listen.

Thanks!

I think if you have your stories written as follows:

  • action_SendQuestion
  • inform
  • action_CheckAnswer

That should work. Basically in your stories you put the (inform) intent between your actions. This way the bot will learn or memorize that this is the sequence to follow.

The reason I would like to force the next two actions is because I actually have two quizzes. You are right, when I had one quiz everything works perfectly, but when I added the second quiz, the NLU would select the wrong CheckAnswer action.

My bot has quizzes like:

  1. (action_SendQuestion1)
  2. (action_listen)
  3. (action_CheckAnswer1)

and

  1. (action_SendQuestion2)
  2. (action_listen)
  3. (action_CheckAnswer2)

Both quizzes are answered with any single word, and have differently functionality. CheckAnswer1 will check a response for a specific string, and CheckAnswer2 will check the response for a certain regex pattern. I’ve tried 3000 lines of stories, to get this working correctly, but it has not been successful. It works correctly about 70% of the time, but I would like it to be perfect.

The NLU will get confused because it can be answered by any single word, and will do something like :

  1. (action_SendQuestion1)
  2. (action_listen)
  3. (action_CheckAnswer2)

Thanks for your suggestion though!

Try 2 FormActions maybe? Described here Slot Filling Have 1 FormAction for Question1 and you do validation inside instead of action_CheckAnswer1 and then the 2nd FormAction for Question2 and you do validation inside that FormAction instead of action_CheckAnswer2.

There’s also another way maybe that I’m working on for this kind of problem. Hopefully we’ll have something for it next week