Hi, I am trying to modify restaurant and build my own RASA formbot. I modified my entities, stories and slot extractor, but for some reason my rasa doesn’t move the dialogue ahead. It’s keep on asking same slot question as if it cannot file below is the code:
actions.py
class PizzaForm(FormAction): “”“Example of a custom form action”“”
def name(self) -> Text:
"""Unique identifier of the form"""
return "pizza_form"
@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
"""A list of required slots that the form has to fill"""
return ["pizza"]
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
"pizza": self.from_entity(entity="pizza", not_intent="chitchat")
}
# USED FOR DOCS: do not rename without updating in docs
@staticmethod
def pizza_db() -> List[Text]:
"""Database of supported cuisines"""
return [
"Cheese",
"Chicken"
]
# USED FOR DOCS: do not rename without updating in docs
def validate_pizza(
self,
value: Text,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> Dict[Text, Any]:
"""Validate cuisine value."""
if value.lower() in self.pizza_db():
# validation succeeded, set the value of the "cuisine" slot to value
print("------------------------>> {}".format(value))
return {"pizza": value}
else:
dispatcher.utter_template("utter_wrong_cuisine", tracker)
# validation failed, set this slot to None, meaning the
# user will be asked for the slot again
return {"pizza": None}
def submit(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
"""Define what the form has to do
after all required slots are filled"""
# utter submit template
dispatcher.utter_template("utter_submit", tracker)
return []
domain.yml
intents:
- make_order: use_entities:
- chitchat: use_entities:
- inform
- affirm
- deny
- stop
- thankyou
- greet
- bot_challenge
entities:
- pizza
slots: pizza: type: unfeaturized auto_fill: false
templates: utter_ask_pizza: - text: “what pizza?” utter_submit: - text: “All done!” utter_slots_values: - text: “I am going to run a restaurant search using the following parameters:\n - cuisine: {pizza}\n” utter_noworries: - text: “you are welcome :)” utter_chitchat: - text: “chitchat” utter_ask_continue: - text: “do you want to continue?” utter_wrong_pizza: - text: “Pizza type is not in the database, please try again” utter_default: - text: “sorry, I didn’t understand you, please try input something else” utter_greet: - text: “Hello! I am Pizza search assistant! How can I help?” utter_iamabot: - text: “I am a bot, powered by Rasa.”
actions:
- utter_slots_values
- utter_noworries
- utter_chitchat
- utter_ask_continue
- utter_greet
- utter_iamabot
forms:
- pizza_form
nlu.md
intent:greet
- Hi
- Hey
- Hi bot
- Hey bot
- Hello
- Good morning
- hi again
- hi folks
- hi Mister
- hi pal!
- hi there
- greetings
- hello everybody
- hello is anybody there
- hello robot
- hallo
- heeey
- hi hi
- hey
- hey hey
- hello there
- hi
- hello
- yo
- hola
- hi?
- hey bot!
- hello friend
intent:make_order
- im hungry looking for pizza
- im looking for a pizza
- i want to order a pizza
- order pizza
- pizza
- chicken pizza
- cheese pizza
- big chicken pizza
- small cheese pizza
- delicious cheese pizza
- perfect chicken pizza
- tasty cheese pizza
- loaded chicken pizza
- very cheese pizza
- smooth cheese pizza
- juciy chicken pizza
- hunger chicken pizza
- top chicken pizza
- awesome chicken pizza
- drooling cheese pizza
- dripping chicken pizza
- power cheese pizza
- medium cheese pizza
- regular cheese pizza
- under chicken pizza
- saturated cheese pizza
- boneless chicken pizza
- crunchy cheese pizza
- munchy cheese pizza
- henoi cheese pizza
- vegetable cheese pizza
- non vegetrain cheese pizza
- chick chicken pizza
- smart cheese pizza
intent:affirm
- yeah a cheap restaurant serving international food
- correct
- ye
- uh yes
- let’s do it
- yeah
- uh yes
- um yes
- yes knocking
- that’s correct
- yes yes
- right
- yea
- yes
- yes right
- yes and i dont care
- right on
- i love that
intent:deny
- no
- no new selection
- no thanks
- no thank you
- uh no
- breath no
- do you have something else
- no this does not work for me
intent:inform
- afghan food
- how bout asian oriental
- what about indian food
- uh how about turkish type of food
- um english
- im looking for tuscan food
- id like moroccan food
- seafood
- french food
- serves british food
- id like canapes
- serving jamaican food
- um what about italian food
- im looking for corsica food
- im looking for world food
- serves french food
- how about indian food
- can i get chinese food
- irish food
- english food
- spanish food
- how bout one that serves portuguese food and is cheap
- german
- korean food
- im looking for romanian food
- serves canapes food
- gastropub
- i want french food
- how about modern european type of food
- it should serve scandinavian food
- how european
- how about european food
- serves traditional food
- indonesian food
- modern european
- serves brazilian
- i would like modern european food
- looking for lebanese food
- portuguese
- european
- i want polish food
- id like thai
- i want to find moroccan food
- afghan
- scottish food
- how about vietnamese
- hi im looking for mexican food
- how about indian type of food
- polynesian food
- mexican
- instead could it be for four people
- any japanese food
- what about thai food
- how about asian oriental food
- im looking for japanese food
- im looking for belgian food
- im looking for turkish food
- serving corsica food
- serving gastro pub
- is there british food
- world food
- im looking for something serves japanese food
- id like a greek
- im looking for malaysian food
- i want to find world food
- serves pan asian food
- looking for afghan food
- that serves portuguese food
- asian oriental food
- russian food
- corsica
- asian oriental
- serving basque food
- how about italian
- looking for spanish food in the center of town
- it should serve gastropub food
- welsh food
- i want vegetarian food
- im looking for swedish food
- um how about chinese food
- world food
- can i have a seafood please
- how about italian food
- how about korean
- corsica food
- scandinavian
- vegetarian food
- what about italian
- how about portuguese food
- serving french food
- tuscan food
- how about uh gastropub
- im looking for creative food
- im looking for malaysian food
- im looking for unusual food
- danish food
- how about spanish food
- im looking for vietnamese food
- spanish
- a restaurant serving romanian food
- im looking for lebanese food
- italian food
- a restaurant with afghan food
- im looking for traditional food
- uh i want cantonese food
- im looking for thai
- i want to seat outside
- i want to seat inside
- i want to seat outdoor
- i want to seat indoor
- let’s go inside
- inside
- outdoor
- prefer sitting indoors
- I would like to seat inside please
- I prefer sitting outside
- my feedback is good
- my feedback is great
- it was terrible
- i consider it success
- you are awful
- for ten people
- 2 people
- for three people
- just one person
- book for seven people
- 2[num_people] please
- nine people
intent:thankyou
- um thank you good bye
- okay cool uh good bye thank you
- okay thank you good bye
- you rock
- and thats all thank you and good bye
- thank you and good bye
- sorry about my mistakes thank you good bye
- noise thank you good bye
- thank you goodbye noise
- okay thank you goodbye
- uh thank you good bye
- thank you goodbye
- thank you goodbye noise thank you goodbye
- breath thank you goodbye
- thank you
- okay thank you
- thanks goodbye
- ah thank you goodbye
- thank you noise
- thank you good bye
- breath thank you very much goodbye
- thanks
- noise thank you goodbye
- unintelligible thank you goodbye
- uh okay thank you good bye
- thank you bye
- um okay thank you good bye
intent:chitchat
- can you share your boss with me?
- i want to get to know your owner
- i want to know the company which designed you
- i want to know the company which generated you
- i want to know the company which invented you
- i want to know who invented you
- May I ask who invented you?
- please tell me the company who created you
- please tell me who created you
- tell me more about your creators
- tell me more about your founders
- Ahoy matey how are you?
- are you alright
- are you having a good day
- Are you ok?
- are you okay
- Do you feel good?
- how are things going
- how are things with you?
- How are things?
- how are you
- how are you doing
- how are you doing this morning
- how are you feeling
- how are you today
- How are you?
- How is the weather today?
- What’s the weather like?
- How is the weather?
- What is the weather at your place?
- Do you have good weather?
- Is it raining?
- What’s it like out there?
- Is it hot or cold?
- Beautiful day, isn’t it?
- What’s the weather forecast?
- Is it quite breezy outside?
intent:stop
- ok then you cant help me
- that was shit, you’re not helping
- you can’t help me
- you can’t help me with what i need
- i guess you can’t help me then
- ok i guess you can’t help me
- that’s not what i want
- ok, but that doesnt help me
- this is leading to nothing
- this conversation is not really helpful
- you cannot help me with what I want
- I think you cant help me
- hm i don’t think you can do what i want
- stop
- stop go back
- do you get anything?
- and you call yourself bot company? pff
- and that’s it?
- nothing else?
intent:bot_challenge
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
stories.md
happy path
- greet
- utter_greet
- make_order
- pizza_form
- form{“pizza”: “pizza_form”}
- form{“pizza”: “null”}
- utter_slots_values
- thankyou
- utter_noworries
bot challenge
- bot_challenge
- utter_iamabot Here’s the output problem. I am asking for cheese pizza but it is keep on asking me same question like slot never got extracted and never moved ahead.