Using RASA in education to build "social practice" dialogues

Hi all

In my possible incoming research project, I’d like to use RASA 2 to build a Italian language learning assistant that implement social practice dialogues, to be used by foreigners students learning Italian language at L2/A1 level (very basic).

In my initial idea, the chatbot could be thought as a set of different “scenes” where the user practices conversations in different daily life situations, talking with different people on each situation, e.g.

  • the learner go to the post office and talk with the employee to send a parcel
  • the learner go to the grocery market to buy some food and talk with the merchant,
  • the learner, that has some injury, call by the emergency phone number to be assisted by an operator
  • etc. etc.

Question:

Technically, in terms of stories/rules is not clear to me (I used RASA 1.8 times ago… and let say I’m a beginner now), Is not clear to me how to organize these (almost independent) scenes/exercises.

Maybe it’s just a matter of arrange “entry-point intents” corresponding to each scene, where each of these intents activate a separated scene/story flow. Does it make sense? Do I need to set-up a RASA rule for each exercise instead?

BTW, possibly consider a “scene” as a social practice situation (the user at the post office). So maybe a scene correspond to many RASA stories.

There is any other approach you could suggest me? Any suggestion is welcome.


Besides, and independently from the conversational design, I want to demonstrate the validity of a “low code” / crowdsourcing capabilities of RASA (X), allowing teachers/authors to collaborates creating/testing/ a collaborative/open-data repository set of scenes/dialogues (in this case concerning Italian language learning).

Thanks

Giorgio

Hi! First of all – this sounds like a very interesting project, looking forward to seeing how it develops.

Have you envisioned how the user would enter these different scenes? That would likely have affect how they should best be organised. In addition, do you imagine common story snippets in these scenes (for example greetings, asking how much something costs, saying goodbye…)?

Hi @fkoerner

Thanks.

Have you envisioned how the user would enter these different scenes?

The idea is to foresee, for each “scene”, an “invocation sentence” (at worst a button) that triggers the scene context.

I’d see a scene as a social practice situation (e.g. being at the post office). In each scene, the learner could be act different dialogues, following different (related) topics/tasks.

In terms of RASA programming, I think about some main intents that trigger the scenes:

nlu:

# Scene: At the post office
- intent: post_office
  examples: |
    - let's go to the post office
    - At the post office

# Scene: At the grocery market
- intent: grocery_market
  examples: |
    - let's go to the grocery market
    - At the grocery market

So I presume I need some main stories/rules to select the scenes, maybe like:

rules:
 - rule: activate post office scene 
   steps:
   - intent: post_office
   - action: utter_post_office_intro

 - rule: activate grocery market scene 
   steps:
   - intent: grocery_market
   - action: utter_grocery_market_intro


do you imagine common story snippets in these scenes (for example greetings, asking how much something costs, saying goodbye…)?

I imagined, for each scene, many different RASA stories. By example in the scene post_office the user could make many different operations, by example sending a parcel, paying a fair, buy some postage-stamps, etc.

I believe each operation/situation could be realized in RASA with one ore more stories. Right?

By examples:

stories:
 - story: send a parcel, talking with the employee 
   steps:
   - intent: greet
   - action: utter_greet
   - intent: send_parcel
   - action: utter_ask_address_to
   - intent: inform
   - action: utter_ask_money
   - action: inform
   - action: utter_thanks
   - intent: goodbye
   - action: utter_goodbye 

 - story: receive a parcel, talking with the employee 
   steps:
   - intent: greet
   - action: utter_greet
   - intent: receive_parcel
   - action: utter_ask_name
   - intent: inform
   - action: utter_ask_address_from
   - intent: inform
   - action: utter_ask_money
   - action: inform
   - action: utter_thanks
   - intent: goodbye
   - action: utter_goodbye 

This is an example of what could it be a dialog flow:

> At the post office
< Scene 1: At the post office. 
< You are inside the post office, in front of the post office employee, Mr. Rossi.  Please ask him what you need!

> good morning
< Good morning! How can I help you?
> I would like to send this parcel to Wien, Austria.
< No problem. I need to weight the parcel. 
< Ok! Weight is 1Kg and 200 grams.
< It costs 11 euros.
> here you are
< Thank you
> Thank you. Good bye
< Have a nice day!

Now, using RASA, what is not clear to me is how link each story (specific exercise) to the scene triggered with a rule.

By example, consider that the user selects the post-office scene : how can I activate the story “receive a parcel, talking with the employee”? I do have to do anything else than writing stories?

Any suggestion is welcome.

Thanks

I see. It looks like your approach is already quite fleshed out and seems like it would work.

However, I think it may be easier to think of this in terms of the shared turns, and in terms of the turns that only make sense in certain settings. For shared turns, like below, which are not limited to one setting (you could also have an interaction like this in the supermarket), you can define the behaviour using rules, or stories.

   - action: utter_thanks
   - intent: goodbye
   - action: utter_goodbye

Then there are turns or story snippets that are setting-specific, for example the intent send_parcel would not make sense in the supermarket. For these, you may want to use rules or forms to ensure that the behaviour always matches the setting.

For example, most of the setting-specific interactions you’ve mentioned are triggered by the user intent like send_parcel. So you don’t need to worry about the interactions being appropriate for the setting from the bot side. As for the user intent, you could either:

  1. hope that the user is compliant and doesn’t ask about parcels in the supermarket (for example), or:
  2. write rules for either scenario, so for example:
- rule: Send parcel at post office
  condition:
  - slot_was_set:
    - location: post_office
  steps:
  - intent: send_parcel
  - action: utter_ask_address_to

- rule: Reject send parcel at supermarket
  condition:
  - slot_was_set:
    - location: supermarket
  steps:
  - intent: send_parcel
  - action: utter_cant_help

where utter_cant_help might be something like “I’m sorry, I can’t help with that”.

For multiple turns in a particular setting it may be helpful to use a form, which require a slot to be filled. For example, for sending a parcel the form could cover cover multiple requirements, like the address, whether to use priority shipping, the weight, so on. This will allow the system to ask for the slot if the user hasn’t supplied it.

The gist of this is that it’s less about activating a story, and more about making sure that:

  1. The user is only allowed to perform appropriate tasks in their current setting (e.g. only sends parcels in the post office). If they try to perform an inappropriate task, remind them where they are and what they can do there. This also means (although your examples don’t cover this) that the bot mustn’t offer an inappropriate task for the setting (e.g. in the post office, the bot doesn’t say something like “would you like a bag for your groceries?”). If you need help with the bot behaviour we can work through an example.
  2. The bot responds correctly to the task the user would like to carry out. For your examples, this should be as simple as responding correctly to an intent (e.g. don’t say utter_ask_address_to when the user says something classified as intent: receive_parcel). This is a bit simpler than following an entire story, as the correct action is not dependent on many previous turns.

Does that make sense?

1 Like

Thanks @fkoerner for you thoughts and examples!

You helped me to clear some points but rightly :slight_smile: you are reminding some challenges I didn’t think about.

(1) Splitting a story in small-talks turns

If I well understand, you are suggesting to split stories in small chunk/sequences of turn takings, mixing “no setting-specific” (reusable in different scenes) sequences with setting-specific ( = scene-specific). Ok.

I see advantages of the splitting, but I have a question here: breaking a story in separated set of sequences, doesn’t this reduces the RASA conversation engine ability to predict next step in a story?


(2) Using forms

For sure forms are the way to go for a real goal-oriented situation where the bot has to collect data and processing them for a contextual action. But I’m still perplexed to use forms, because dialog authors are no-programmers (I’ll possibly mentor language teachers, phd students in linguistics, people more focused on language teaching without any dev skill, so I would want to minimize coding (form) actions, that could offuscate the dialog behavior for no coder people.

I maybe would prefer that any “slot” info collection could be explicit in turn taking and not encapsulated in the python actions code.

That just because the goal of the project is not just to supply a set of “exercises of conversation” obtained by any (programming) means. Instead I would like to create an open-data growing set of conversation examples (stories in a broad sense), to be enriched, updated and maintained by teachers (say no-coders conversation authors) :slight_smile: .

But this is just a draft feeling.


(3) Dialog interferences / Out of context user requests

Thanks for pointing out the issue. This complicates things. At first i could forget the problem, but you are right when you say that the user/learner could ask, by example in the post office scene, something about purchasing at grocery, and that could be managed gracefully by the bot in that “setting”.

One could set-up rules using slots, ok but I’m perplexed because in this way conversations become more and more less readable.

I believe that the application I want to build is in facts a multi-bot scenario, where each scene is all in all a pretty different situation, a different bot (last but not least, with a different bot-persona).

Maybe do I have to rethink the dialogs simulator as a joint of fully separated bots? :wink: I confess I’m a bit confused now.


(4) A metabot conversations design approach?

The application in object is for a language learner person that has to study Italian language at very basic level (L2/A1). This increases the cognitive complexity too. For my previous experience working on CPIabot, a research project for the Italian public adult schools for foreigners, I know that the A1 / Pre-A1 is very challenging because user are really confused not just because the target language learning but also because cultural common senses, cognitive abilities, etc.

To “guide” user in scene I’m thinking about letting aware the student of the conversational agent as an assistant (with his own personality) that drive / helps learner in the scenes, as it was a real-life friend that want to help in each situation, suggesting how to do step-by-step in each interlocutor request/ask (the post office employee, the grocery merchant, etc.)

So one idea come in my mind is to follow (each/some) bot utterances / requests with a sort of assistant suggestion). From the UI interaction perspective (say on Telegram) what is still not clear to me is how to clearly separate the actor-utterances from the assistant suggestions/tips. With an initial icon?

:warning: scene 2: At the post office


:woman_office_worker: Good morning! Ho can I help you?


:bulb: You can: send a parcel, pick up a package, etc. Example: I want to send a parcel


Does it make sense? Any suggestion to improve the UI/UX?

BTW, any suggestion by anyone is absolutely welcome!

Thanks again

Giorgio

(1)

If I well understand, you are suggesting to split stories in small chunk/sequences of turn takings

You don’t necessarily have to split all of your stories. I meant more to think about the turns separately. It’s easiest if you think about the turns (or sequences of turns) either as: story snippets that are shared, and should be handled consistently. These can be turned into rules, and stories that are specific to a setting. You can still keep your stories as-is, or split them up, and just because you decide to turn something into a rule, doesn’t mean it has to be taken out of the story. If I were you, I’d probably write some rules for greeting, saying goodbye:

- rule: Say goodbye anytime the user says goodbye
  steps:
  - intent: goodbye
  - action: utter_goodbye
- rule: greet user
  steps:
  - intent: greet
  - action: utter_greet

I’d also use the response selector for chit-chat that is common across scenarios. So you might expect the bot to handle small-talk about the weather, regardless of whether you’re at the post office or the supermarket. Our demo bot has an intent for asking about the weather and a set of responses.

But your stories can also contain the expected flow. Generally, you might start with the “happy path”, meaning everything goes right. These are the stories you already have. I wouldn’t remove the greetings from those stories, even though you have them as rules.

doesn’t this reduces the RASA conversation engine ability to predict next step

I wouldn’t break them up too small and if you expect one flow to go to another you can have them overlap or use checkpoints. But it’s okay if a story isn’t complete. If you’re concerned about this, we can look at your configuration and see, but it’s worth just trying it out and going from there.

(2) Those are all valid points, and good enough reasons to avoid forms for this particular application.

(3) Building multi-bots would be one way to do it, though the disadvantage is that each bot would have to learn the “shared” things (like greetings), and managing the multiple bots may become cumbersome. I also understand your concern about the conversations becoming less readable. It’s up to you whether you think this is worth it. Perhaps you can use the metabots design approach you described in the next point to guide users, and if they choose to attempt a task that isn’t appropriate for the setting, then they/you have to live with that :slight_smile: Since this is an educational tool, it seems to me it’s not so critical that they tasks taken are appropriate for the setting if the user has initiated this.

(4) I think this is a really great idea! Here you can also guide users (as you have done in your examples) as to what they can do in the scenario. I think an emoji is a good way to communicate this. I am not an UI/UX expert by any means, so hopefully someone in the community might weigh in :slight_smile:

1 Like

Thanks Felicia! Any help from community is very welcome.

1 Like

You’re very welcome! This is a cool project, please keep us posted if you like :slight_smile:

1 Like