Rasa Core - How to write reliable stories

rasa-core

(C Süess) #1

Today I tried out Rasa Core to see if it is really the better alternative too a decision tree. I made up a super simple story and did not include any actions, only simple utterances.

Idea

The idea is,…

…that I can order drinks in a loop until I’m satisfied

…each time I order a “fanta”, the bot makes an additional comment “bamboocha”

That’s it!

Problem

I don’t make it to build such a flow. I tried many different stories, but always had some problems. In the attached sample I have the following problems:

  • If I order a coke after the greeting, the bot tells me “bamboocha” (should only happen with fanta)
  • The visualisation shows me a loop for order a drink, but not one for ordering fanta

Questions

Can you help me…

  • …to solve the specific problem?
  • …with general knowledge how to write stories?
  • …to get rid of my doubts, that this never can work for a complex project, if I have already so many problem with this super simple example?

Training data

Stories

## story_greet
* greet
 - utter_greet
> check_greet

## story_order_drink
> check_greet
* orderdrink
 - utter_anythingelse
* orderdrink
 - utter_anythingelse
> check_finish

## story_order_fanta_1
> check_greet
* orderdrink
 - utter_anythingelse
* orderdrink{"drink":"fanta"}
 - utter_bamboocha
 - utter_anythingelse
> check_finish

## story_order_fanta_2
> check_greet
* orderdrink{"drink":"fanta"}
 - utter_bamboocha
 - utter_anythingelse
* orderdrink
 - utter_anythingelse
> check_finish

## story_finish
> check_finish
* finish
 - utter_goodbye

Visualisation, Domain and NLU

domain.yml (351 Bytes) graph.html (4.8 KB) nlu_data.md (1.0 KB)

I’m more than curious for your inputs. Many thanks!


(C Süess) #2

Are there any field reports, best practices or just experiences with RASA Core and the use of sample stories? Where you I find them?


(weberi) #3

Hi Chris, have you already tried using a slot for drinks, and specifically a slot of type categorized? Slots and slot types are declared in the domain.yml like

slots: drink: type: categorical values: - fanta - rivella

See here in the docs: https://rasa.com/docs/core/slots/ https://rasa.com/docs/core/api/slots_api/

If you give it a try, please let me know what you found.