Slot filling in a bot conversation

(Sanyog Yadav) #1

I am building a restaurant search bot and in one of the options the user gets to choose a cuisine. Now instead of entering the cuisine type, it enters the option number. I would like that the bot understands the user implied that particular cuisine. Any ideas how to implement this?

(Anders) #2

Why not duplicate the example from rasa’s restaurant bot, and replace the cuisine type with a number? e.g.:

## intent:cuisine_number
 - i want to order nr. [1](entity_number)
 - i want to order nr. [2](entity_number)
 - i want to order nr. [3](entity_number)

Then in a custom action you use a list to map from number to food type.

foodList = ['null', 'italian', 'thai', 'mexican']    
dispatcher.utter_message("food type: " + str(foodList[entity_number]))

(Sanyog Yadav) #3

Thanks a lot for your response. The idea you gave made a lot of sense and I was able to implement it successfully.

Have a great weekend.