I tried to “translate” a hotel reservation bot I created in Rasa 2.6 to Rasa 3.0, and my categorical slots aren’t working. I cannot quite figure out why.
Here is most of my nlu.yml:
version: "3.0"
nlu:
- intent: hotel_reservation
examples: |
- [single](room_type) room
- [single](room_type) room please
- [single](room_type) bed
- [single](room_type) bedroom please
- do you have a [single](room_type) room?
- i want a [single](room_type) room
- [double](room_type) room
- [double](room_type) room please
- [double](room_type) bed
- [double](room_type) bedroom please
- do you have a [double](room_type) room?
- i want a [double](room_type) room
- [king sized]{"entity": "room_type", "value": "double"}
- [king sized]{"entity": "room_type", "value": "double"} please
- [king size]{"entity": "room_type", "value": "double"} bed
- [king sized]{"entity": "room_type", "value": "double"} room
- [king size]{"entity": "room_type", "value": "double"} bed in my room please
- do you have a [king size]{"entity": "room_type", "value": "double"} room?
- i want a [king size]{"entity": "room_type", "value": "double"} room
- [1]{"entity": "no_of_guests", "value": "1"}
- [2]{"entity": "no_of_guests", "value": "2"}
- [3]{"entity": "no_of_guests", "value": "3"}
- [one]{"entity": "no_of_guests", "value": "1"}
- [two]{"entity": "no_of_guests", "value": "2"}
- [three]{"entity": "no_of_guests", "value": "3"}
- only [one person]{"entity": "no_of_guests", "value": "1"} will attend
- [one person]{"entity": "no_of_guests", "value": "1"} only
- [just me]{"entity": "no_of_guests", "value": "1"}
- all [three]{"entity": "no_of_guests", "value": "3"}
- [three]{"entity": "no_of_guests", "value": "3"} people
- [2 people]{"entity": "no_of_guests", "value": "2"}
- [two people]{"entity": "no_of_guests", "value": "2"}
The rules.yml:
version: "3.0"
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
- rule: Say 'I am a bot' anytime the user challenges
steps:
- intent: bot_challenge
- action: utter_iamabot
- rule: activate hotel reservation form
steps:
- intent: hotel_reservation
- action: hotel_reservation_from
- active_loop: hotel_reservation_from
- rule: submit form for making a hotel reservation
condition:
- active_loop: hotel_reservation_from
steps:
- action: hotel_reservation_from
- active_loop: null
- action: utter_completed_hotel_reservation
- action: utter_goodbye
The pipeline config.yml
# The config recipe.
# https://rasa.com/docs/rasa/model-configuration/
recipe: default.v1
# Configuration for Rasa NLU.
# https://rasa.com/docs/rasa/nlu/components/
language: en
pipeline:
# No configuration for the NLU pipeline was provided. The following default pipeline was used to train your model.
# If you'd like to customize it, uncomment and adjust the pipeline.
# See https://rasa.com/docs/rasa/tuning-your-model for more information.
- name: WhitespaceTokenizer
- name: RegexFeaturizer
- name: LexicalSyntacticFeaturizer
- name: CountVectorsFeaturizer
- name: CountVectorsFeaturizer
analyzer: char_wb
min_ngram: 1
max_ngram: 4
- name: DIETClassifier
epochs: 100
constrain_similarities: true
- name: EntitySynonymMapper
- name: ResponseSelector
epochs: 100
constrain_similarities: true
- name: FallbackClassifier
threshold: 0.3
ambiguity_threshold: 0.1
- name: "SpacyNLP"
# language model to load
model: "en_core_web_md"
case_sensitive: False
# language model to load
- name: "SpacyEntityExtractor"
dimensions: ["DATE"]
ambiguity_threshold: 0.1
and the rules.yml:
version: "3.0"
intents:
- greet
- goodbye
- affirm
- deny
- bot_challenge
- hotel_reservation
entities:
- DATE
- room_type
- no_of_guests
responses:
utter_greet:
- text: "Hey! How are you?"
utter_did_that_help:
- text: "Did that help you?"
utter_ask_arrival_date:
- text: "On what date will you arrive?"
utter_ask_departure_date:
- text: "What date would you like to depart?"
utter_ask_room_type:
- text: "What room type would you like to book? (single or double)"
utter_ask_no_of_guests:
- text: "How many guests would you like to book for the room?"
utter_completed_hotel_reservation:
- text: "Thank you for making the reservation! The room booked is a {room_type}"
utter_ask_room_type_not_recognized:
- text: "The room type has not been recognised. Please try again with either single or double"
utter_goodbye:
- text: "Bye"
utter_iamabot:
- text: "I am a bot, powered by Rasa."
slots:
arrival_date:
type: text
mappings:
- type: from_entity
entity: DATE
influence_conversation: false
departure_date:
type: text
mappings:
- type: from_entity
entity: DATE
influence_conversation: false
no_of_guests:
type: categorical
values:
- 1
- 2
- 3
mappings:
- type: custom
room_type:
type: categorical
values:
- single
- double
mappings:
- type: custom
forms:
hotel_reservation_from:
required_slots:
- no_of_guests
- room_type
- arrival_date
- departure_date
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
Hope someone can let me know what I have done wrong. Only the categorical slots are not working. The arrival_date
and departure_date
are working just fine. I have been stuck on this for a while now. Thank you (: