Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Understanding RASA-Core stories

Tags:

rasa-nlu

I was trying to understand the examples given in RASA core git. I have seen an example story

  • greet
  • utter_ask_howcanhelp
  • inform{"cuisine": "italian"}
  • utter_on_it
  • utter_ask_location

But I didn't understand what {"cuisine": "italian"} is. Whether it is the default value of the slot or user has to provide italian in the input string. Can anybody help me to understand how to write stories in RASA core

Regards

like image 276
Raghavendra Avatar asked Feb 16 '18 09:02

Raghavendra


People also ask

What are stories in Rasa?

A story is a representation of a conversation between a user and an AI assistant, converted into a specific format where user inputs are expressed as intents (and entities when necessary), while the assistant's responses and actions are expressed as action names.

What is rules in Rasa?

Rules are a type of training data used to train your assistant's dialogue management model. Rules describe short pieces of conversations that should always follow the same path. Don't overuse rules.

What is checkpoint in Rasa?

RASA (25 Part Series) You can use checkpoints to modularize and simplify your stories. Checkpoints can be useful, but do not overuse them. Using lots of checkpoints can quickly make your example stories hard to understand, and will slow down training. Here is an example that contains checkpoints: # stories.yml # ...


2 Answers

One of the most powerful features of any dialog flow is stories. This is how you are telling the model what are the possible flows of conversational dialog.

In the questions you have asked about. Clearly the Italian is not the default value. inform{"cuisine": "italian"}

Here you are telling the machine learning engine that you are looking for an Intent 'Inform' which will have a slot named cuisine. Here Italian is an example. At the runtime, it can be anything. You can also have another story line where Intent inform without cuisine slot. That story might ask for cuisine in the next dialog.

Defining the story lines, should not be confused with programming language. It is just an indication for Machine learning algorithms.

More details about using slots can be found here and here

like image 79
Karthik Sunil Avatar answered Nov 10 '22 18:11

Karthik Sunil


This story describes how the dialogue model would behave in the case the user said something like "I want to eat Italian food". As you note, the slot "cuisine" is set to the value "italian".

In the restaurant example, the cuisine slot is a simple TextSlot. This means that the dialogue model only gets to see if the slot has a value or not. The behaviour would be exactly the same if the user had asked for chinese food, thai food, or anything else.

If you want the value of a slot to influence the dialogue going forward, you can use a different slot type, e.g. a categorical slot

like image 20
amn41 Avatar answered Nov 10 '22 19:11

amn41