Rasa Core version :0.12.3
Python version : Python 3.6.8
Operating system (windows, osx, …): Ubuntu 16.04
Issue : dialog is not following stories.md after introducing custom actions. Using Jupyter notebook for writing and testing the code.
I am really new to Rasa and have been exploring it for the purpose of building a chatbot. Having a difficult time when it comes to custom actions.
I was playing with utterances in the actions till now and the flow of dialog was going fine. I tried writing some custom actions for the chatbot but the flow gets struck in the first conversation itself.
a path in stories.md file is as below:-
#happy path model enquiry 1
- greet
- utter_greet
- Customer_enquiry_model
- action_get_model_config
- utter_did_that_help
- mood_affirm
- utter_mood_affirm
- OPPO_Phones_Price
- action_get_model_price
- utter_did_that_help
- mood_affirm
- utter_mood_affirm
- goodbye
- utter_goodbye
For the path mentioned , I am getting :-
Your bot is ready to talk! Type your messages here or send ‘stop’
Me :Hi I am Arghya
Bot : I am not sure what you are aiming for.
expected :- utter_greet
it seems that the bot is not able to predict the action as in the path.
Please guide me where i am going wrong and nudge me to the right direction.
the nlu.md training file is as below :-
intent:CEO_info
- what about ur CEO
- and ceo
- about CEO
- what about ur CEO
- oppo’s chief executive officer
- ceo?
- CEO?
- name of CEO
- who is your CEO?
- CHIEF EXECUTING OFFICER?
intent:CustomerCare_info
- what is ur cc no?
- customer service no
- toll free no
- what is your toll free no
- give me cc [toll free no] (information)
- do u care for ur customers.
- can u support customer?
- provide your customer help line number
- how will we contact oppo?
- Contact number
- Phone number
- cell number
- help line number
- What is your customer care number?
- give me your customer care number?
intent:Customer_enquiry_model
- Yes I am looking for f10
- I want to know about f20
- tell me about f10
- give me the detail of model name
- I would say model name
- details about f20
- information about f30
- enlighten me about x10
- looking for this model
intent:OPPO_Phones_Price
- want to buy F7 what is the price?
- wanna buy E10, tell me the price?
- interested in f7, give me the price
- interested to go for t66, price pls
- what is the market value of f7?
- may I know the worth of f7?
- can I have the price of g14?
- let me know the price of e10?
- share the price of x20?
- want to know the price of i10?
- price of ur phone please?
- do u have the price of y10
- price please
- what is the price
- price of this particular phone
intent:Official_Website
- Business URL
- how to visit ur website
- Your Website url
- ur web portal
- official portalurl
- what is your url
- give me the url of your official website.
- link of your website please
- get me the link to your website
- uniform resource locator for your website
intent:Oppo_store_ocation
- shop address please
- Where is your shop situated?
- your nearest shop address
- tell me your location please
- where are you located at?
- give me your shop address
- where is your outlet at?
- nearest store please
- where is the nearest store?
- where is the nearest store of oppo?
- shop near to me
- address of the shop near to me
- location of the shop near to me
intent:Oppo_product_comparison
- Feature list of f7 and f2
- Cpu Model of g10 and g12
- screen comparison between x10 and x11
- Processor comparison between f10 and f15
- display comparison of f15 and f11
- can u give me the comparison of g11 and h12
- Memory details of x11 and x12
- battery life of Model1 and Model2
- which phone is better between model1 and model2
- which model is better
- can I compare ur models
- need to compare OPPO models
- I want to compare oppo models
- may I have the comparison
- feature comparison
- specificaton comparison
- display comparison
- can I have the CPU comparison between Model1 and Model2
- could u pls give the comparison of model1 and model2
- let me know the camera specification of model1 and model2
- memory specification of model1 and model2
- which is best between Model1 and model2
intent:Service_Center_OR_Factory
- Where is your workshop?
- workshop located at
- location of workshop?
- where is your workshop located?
- May i know about your workshop location?
- where is the workshop situated?
- where is your service centre located at?
- location of oppo’s service centre?
- address of your service centre?
- workshop near to me
- service centre near to me
- service centre nearby me
intent:about_OPPO
- ollie what do you know about oppo?
- what is oppo?
- what do you know about oppo?
- which field you belong to?
- what is ur business?
- what is oppo about?
- what do u do?
- can i know about ur services?
- what does Oppo do?
intent:brand_info
- Ollie what brand you belong to?
- what is ur brand?
- brand name?
- which brand do you represent?
- which brand do you work for?
- give me some information about the brand you are working for.
- may I know about your brand name?
- which brand are you?
intent:goodbye
- see you
- good by
- see you later
- bye
- goodbye
- have a nice day
- see you around
- bye bye
- see you later
- that’s all!Thank you.
- Nope.take care.
- I got all I need.Thanks.
- It was really helpful.Thanks.
- Ciao
intent:greet
- hey I am Peter
- hello there I am Hans
- hi I am Tom
- hello there
- good morning
- good evening
- morning
- hey there
- let’s go
- hey dude
- good morning
- good evening
- good afternoon
- Hi,I am Arghya
- hi
- hello
- hi Arghya here
intent:city_name
- I live in Delhi
- Kolkata
- My city is Gurgaon
- Lucknow is my city
- city is Faridabad
- The city where I live is Bangalore
- MY CITY MUMBAI
- I am from CHENNAI
intent:model_name_lookout
- I want to know about g12 and x12
- tell me about t16 and f7
- I am interested in Model1 and Model2.
- give me the detail of Model1 and Model2
- Take Model1 and Model2
- I would say Model1 and Model2
- compare Model1 and Model2
intent:mood_affirm
- yes
- indeed
- of course
- that sounds good
- correct
- sure
- exactly
- hundred percent correct
- that’s right
- yup
- yeep
- sounds right
- looks nice
intent:mood_deny
- no
- never
- I don’t think so
- don’t like that
- no way
- not really
- nope
- na
- not exactly
- double no
- not that
intent:provide_founder
- Oppo is Owned by whom?
- Oppo is established by?
- Can u tell me owner
- who is oppo’s owner
- oppo’s owner
- who owns Oppo?
- Oppo founded by whom?
- Who is the founder of oppo?
- oppo is owned by whom?
- oppo mobile is owned by whom?
- who owns oppo?
- tell me the name of the owner of oppo.
- name of the owner?
- owner’s name?
- owner please?
- who is the owner of oppo?
lookup:PERSON
/home/arghya/rasa_test/data/place_finder/PERSON.txt
lookup:model
/home/arghya/rasa_test/data/place_finder/model.txt
lookup:customer_location
/home/arghya/rasa_test/data/place_finder/customer_location.txt
action server code :-
from future import absolute_import
from future import division
from future import unicode_literals
from rasa_core.domain import Domain
from rasa_core.trackers import EventVerbosity
import logging
logger = logging.getLogger( name )
import requests
import json
from rasa_core_sdk import Action
from rasa_core_sdk.events import SlotSet
from rasa_core_sdk.events import UserUtteranceReverted
from rasa_core_sdk.events import AllSlotsReset
from rasa_core_sdk.events import Restarted
class SaveCityName(Action):
def name(self):
return 'action_save_city_name'
def run(self, dispatcher, tracker, domain):
orig = next(tracker.get_latest_entity_values("customer_location"), None)
if not orig:
dispatcher.utter_message("Please enter a valid city name")
return [UserUtteranceReverted()]
return [SlotSet('customer_location',orig)]
class SaveModelName(Action):
def name(self):
return 'action_save_model_name'
def run(self, dispatcher, tracker, domain):
inp = next(tracker.get_latest_entity_values("model"), None)
if not inp:
dispatcher.utter_message("Please enter a valid model")
return [UserUtteranceReverted()]
return [SlotSet('model',inp)]
class ActionSlotReset(Action):
def name(self):
return 'action_slot_reset'
def run(self, dispatcher, tracker, domain):
return[AllSlotsReset()]
class getServiceCentreLocation(Action):
def name(self):
return 'action_get_service_centre_location'
def run(self):
print("you will receive the service location once the database is up.Working on it :) ")
pass
class getShopLocation(Action):
def name(self):
return 'action_get_shop_location'
def run(self):
print("you will receive the shop location once the database is up and running.Thanks for the wait.Next Question please? :)")
pass
class getModelPrice(Action):
def name(self):
return 'action_get_model_price'
def run(self):
print("you will receive the price of the model once the database is up and running.Thanks for the wait.Next Question please? :)")
pass
class getModelConfig(Action):
def name(self):
return 'action_get_model_config'
def run(self):
print("you will receive the model configuration once the database is up and running.Thanks for the wait.Next Question please? :)")
pass
Content of domain file (if used & relevant): domain.yml
intents:
- greet
- goodbye
- provide_founder
- about_OPPO
- brand_info
- CustomerCare_info
- Service_Center_OR_Factory
- Oppo_store_location
- CEO_info
- Official_Website
- OPPO_Phones_Price
- Customer_enquiry_model
- Oppo_product_comparison
- model_name_lookout
- mood_affirm
- mood_deny
- city_name
slots: PERSON: type: text model: type: text customer_location: type: text workshop_location: type: text shop_location: type: text
entities:
- PERSON
- information
- customer_location
- workshop_location
- shop_location
- web_address
- model
- feature
actions:
-
utter_greet
-
utter_goodbye
-
utter_did_that_help
-
utter_unclear
-
utter_city_name
-
utter_Oppo_shop_location
-
utter_provide_founder
-
utter_about_OPPO
-
utter_brand_info
-
utter_CustomerCare_info
-
utter_Service_Center_OR_Factory
-
utter_CEO_info
-
utter_Official_Website
-
utter_OPPO_Phones_Price
-
utter_Customer_enquiry_model
-
utter_Oppo_product_comparison
-
utter_model_name_lookout
-
utter_mood_affirm
-
utter_mood_deny
-
utter_happy
-
utter_more_info
-
utter_thanks
-
utter_deny
-
utter_confirm
-
utter_check_another_one
-
action_save_city_name
-
action_get_service_centre_location
-
action_slot_reset
-
action_get_shop_location
-
action_save_model_name
-
action_get_model_price
-
action_restart
-
action_get_model_config templates: utter_greet:
- text: “Hey, {PERSON}!This is Ollie,your assistant.How may I help you?”
- text: “Hi {PERSON}!I am here to help.Shoot!”
- text: “Hi,how can I help you?”
utter_goodbye:
- text: “Bye {PERSON} and take care!”
- text: “Bye”
utter_did_that_help:
- text: “Did that help you {PERSON}?”
utter_unclear:
- text: “I am not sure what you are aiming for.”
utter_thanks:
- text: “You are very welcome.”
- text: “Glad I could help!” utter_deny:
- text: “That’s a shame. Let me know if you change your mind.”
utter_provide_founder:
- text: “Oppo’s founder is Chen Mingyong.”
utter_about_OPPO:
- text: “Oppo Electronics Corporation, commonly referred to as Oppo, is a Chinese consumer electronics and mobile communication company, known for its smartphones, Blu-ray players and other electronic devices. A leading manufacturer of smartphones, Oppo was the top smartphone brand in China in 2016 and was ranked No. 8 worldwide”
utter_brand_info:
- text: “I work for Oppo Mobile”
utter_CustomerCare_info:
- text: “Oppo’s customer care number is 1800 103 2777”
utter_CEO_info:
- text: “CEO of Oppo is Chen Mingyong.Started his position from 2/11/2017.”
utter_Official_Website:
- text: “Official website is: www.oppo.in”
utter_Oppo_product_comparison:
- text: “Decision is yours:Here is the feature list of {model} and {model}:”
utter_happy:
- text: “Great carry on!”
utter_more_info:
- text: “Please provide more details so that i can understand your query”
utter_mood_affirm:
- text: “Glad that i was useful.Next Question if any?”
utter_mood_deny:
- text: “Try again!”
utter_city_name:
- text: “Which city are you from {PERSON}?”
- text: “Which city are you from?”
- text: “Name of the city please?”
utter_confirm:
- text: “I will be making inquiry for customer_location: {customer_location}. Is that correct?” utter_check_another_one:
- text: “Do you want to make another inquiry?”