Stories issue in rasa


(e8180kimo) #1

My bot guides learners to write their essays. Now we have troubles of getting the bot to match the right utterances. For example, when a learner clicks/activates the intent “thesis”, the bot will not move forward to utter_def_thesis. Instead, the bot will go to the end, utter_other_help, “Do you need other help?” Because of the complexities of our story structure, we’ve made sure that the path has defined well in the story like below:

## general  thesis beginning
*greet
  -utter_greet
*thesis
  -utter_def_thesis

## general arg beginning
*greet
  -utter_greet
*arg
  -utter_def_arg

## thesis path
*thesis
  -utter_def_thesis
*confirm
  - utter_thesis
*confirm
  - utter_other_help

##argument path
*arg
  -utter_def_arg
*confirm
  -utter_arg
*confirm
  -utter_other_help

## other_help_path
*confirm
  - utter_other_help
* confirm
  - utter_greet

Will this method of writing story works?

I’ve consulted other people’s posts. It’s my impression that we need to generate all possible stories to our best attempts. But given the complexities of our bot, this will not be possible. I’ve read Keras policies. Is there a way for us to configure Keras policies or NLU pipelines to make our method work, so that we don’t need to drain our brain to write a lot of long stories? The photo is conceptual design.


(Michael Haberl) #3

I have the same issue and in the code of the RASA demo bot Sara it looks indeed like you need to write every storyline (see e.g. rasa-demo/faqs.md at master · RasaHQ/rasa-demo · GitHub)

Which method can I use to create these many combinations of the stories?

And how do you add changes in the stories efficiently? For example i have the story:

*greet
..... a lot of combinations in the stories
*bye

and i would like to switch it to:

*greet
*nice/bad weather today: the temperature is xy°
..... a lot of combinations in the stories
*bye

(Remy Reurling) #4

Yes, sort of but there might be a better way. I see in your story structure that you want to make your stories longer by making multiple smaller stories. That’s okay, but consider using checkpoints to make things easier. For example:

## general  thesis beginning
*greet
  -utter_greet
*thesis
  -utter_def_thesis

## general arg beginning
*greet
  -utter_greet
*arg
  -utter_def_arg

## thesis path
*thesis
  -utter_def_thesis
*confirm
  - utter_thesis
*confirm
  - utter_other_help

##argument path
*arg
  -utter_def_arg
*confirm
  -utter_arg
*confirm
  -utter_other_help

## other_help_path
*confirm
  - utter_other_help
* confirm
  - utter_greet

above is your original story structure. You’re making all kinds of stories that you want to stitch together, denoting them with ‘paths’.

Consider doing this:

## general  thesis beginning
*greet
  -utter_greet
*thesis
  -utter_def_thesis
> check_thesis

## general arg beginning
*greet
  -utter_greet
*arg
  -utter_def_arg

## thesis path
>check_thesis
*thesis
  -utter_def_thesis
*confirm
  - utter_thesis
*confirm
  - utter_other_help

##argument path
>check_thesis
*arg
  -utter_def_arg
*confirm
  -utter_arg
*confirm
  -utter_other_help

## other_help_path
>check_thesis
*confirm
  - utter_other_help
* confirm
  - utter_greet

You see I added ‘checkpoints’ in your story. What this does is force rasa to see your first greet + thesis question story as the first part of larger stories that differentiate based on what the user says. It’s basically the same as making the story longer. This avoids repetition and makes your story generation a little easier.

You can then copypaste the stories you have after the checkpoint and remove the checkpoint altogether. Your bot will then either go directly into that story if the user directly asks for it and see it as part of a larger story that has multiple pathways.

I hope this makes sense to you! GL!


(Remy Reurling) #5

Same as the above answer: use checkpoints:

## greet
*greet
>check_greet

## story 1
>check_greet
*question
    -utter_answer

## story 1 direct
*question
    -utter_answer

(Michael Haberl) #6

Thank you. I’ll try that.