Use of different forms based on the entity extracted

My requirement is,

User : hello

RasaBot : hello, what service you want?

User : restaurant

RasaBot : Provide the number of people ,time and cuisine.

User : For 4 people, at 7PM , mexican cuisine.

RasBot : booked this resaturant ABC…blh…blah…

===========

User : hello

RasaBot : hello, what service you want?

User : movie

RasaBot : Provide the number of people ,time and theatre preference

User : For 4 people, at 7PM , XYZ theatre.

RasBot : booked this movie show blah,blah,

====================

User : hello

RasaBot : hello, what service you want?

User : haircut

RasaBot : Provide me the time

User : for 7 pm

RasBot : booked this salon at 7 PM…blah…blah…

=============

As you can see, based on the first entity response, bot should ask different set of questions(form)…how do we achieve this?

You should be able to write your stories like this:

# Story 1: Restaurant Service
* greet
  - utter_ask_service
* request_service{"service":"restaurant"}
  - restaurant_form

# Story 2: Movie Service
* greet
  - utter_ask_service
* request_service{"service":"movie"}
  - movie_form

...

The intent request_service captures the name of the service the user wants to use. You will have an entity and a slot called service. Make sure to have some examples in your NLU data that define, for example, “restaurant” as service. Depending on the service entity that was found, Rasa will pick up the correct form. Add MemoizationPolicy and FormPolicy to your policies in your configuration file.

Does that help?

Forgot one thing: service slot should be categorical and then you should have the slot event as well. By default featurization of entities in intents is only based on whether or not a certain entity is extracted, so the actual entity value won’t change the dialogue history unless thrown into a categorical slot.

Great To Read:heart_eyes: Regards William