Get name from intent and reply it in the action

Hi, i’m new to rasa and i’m trying a simple chatbot. In my case, i want to get the name of the person who chat and then provide the reply action with his name. An example is given below.

Me - Hi i’m Dushan

RasaBot - hi Dushan, How are you

Something like above.

Dushan you can easily make such a bot by reading https://rasa.com/docs/rasa/.

You want your name (entity ) to be extracted from your greeting sentence( or greet intent). So create the stories.md and nlu.md accordingly. Then train your rasa model on it. After that, it will be able to reply the way you want it to.

can you please tell me the exact location to follow. Right now i’m looking at many document pages and some samples. If you can give me an exact location, it would be great. Btw i got a clue that i can use slots.

You’ll need to do the following:

  1. Write NLU training data to detect intent and entities
  2. Add a slot with the same name as the entity (in your case, name)
  3. Define a story where the user entering their name is followed by an utter_greet or something
  4. Define utter_greet in the domain file to be a template utterance (something like Hi {name}, how are you?)
3 Likes

hey, thanks a lot @msamogh It worked :slight_smile:

1 Like

@msamogh has explained it very nicely in a step by step manner.

Can you provide an example on the first step here? I tried using a regex pattern but it’s not detecting the name. I ended up training about 60 names and that ended up working. It seems like this should be simpler.

@crystaltaggart Could you post this as a new question? :slight_smile: