Hi Guys ,
I’m in the process of building my first bot. I am using forms to extract entites ,name, email, pincode and mobile number and set them as slots ( of the same name ). They are handled by form user_info in the same order.Then just simply return the names back to the user.
The bot is after initiating the form, extracts the name entity and sets the slot value. Then moves email. But here I am getting.
ERROR rasa_sdk.endpoint - Failed to extract slot email with action user_info
ERROR rasa.core.actions.action - Failed to extract slot email with action user_info
I have ran the command :
rasa run actions & rasa shell --debug
Please Find the logs below:
1.
file:///home/sanjay/Pictures/Rasa_log1.png user_info2.
file:///home/sanjay/Pictures/rasa_log2.png3.
file:///home/sanjay/Pictures/rasa_log3.png4.
file:///home/sanjay/Pictures/rasa_log4.png5.
file:///home/sanjay/Pictures/rasa_log5.pngIn the end the entities all the four entities(name, email, pincode, mob_number) are extracted and I get the output too.
Please also find my files :
1.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
- hi
intent:give_name
- hey , this is Charlie
- hello , Shyam here.
- hi , I’m Ram
- good morning , my name is Lucas
- good evening , I’m Pedro
- hey there , I am Todd
- hi, my name is John
- I am nick
- Hey there , Brad
- Bond,James Bond
- Anand
- Abhishek
- Vivek
- Marco
- Joe
- Praveen
- Kevin
- Anirudh
- Arun
- Rohith
- Adithya
- Jerry
- Tom
- my name is Peter Parker
##intent:give_email
- my email id is abc@xyz.com
- my mail id is arun12@gmail.com
- johnreeves37834@hotmail.com
- my business mail is s_Dibenedetto@Simpson.net
- it is Carole@Hart.com
- my email is Elinor_Stock@Higgenbotham.com
- my email is K_Spivey@yahoo.com
- my email is Kelly@Coulter.net
- my email is M_Jones@Luna.com
- email id is Mia_Gainey@gmail.com
- my email is S_Calderon@Cofield.com
- my email is Virginia@Brown.com
- my emayl is V_Comley@Nelson.com
- flowersblooms45@reddit.com
- Mail id is Parker123@gmail.com
##intent:give_pincode
- 673032
- my pin code is 120277
- my pin code is 836602
- my pin code is 474516
- i am at 771044.
- i stay at 547025
- pin code is 342081
- it is 635582
- the pincode is 844004
- pincode 458760
- 123456
- sure it is 905678
- I live at 340001
- I am located at 987511
##intent:give_mobile
- sure it is 9357724413
- my contact number is 8075430831
- my number is 7703486422
- Contact me at 8089447356
- it’s 9447567341
- 8983617830
- 9957314135
- 8182367744
- Yeah it is 9845518855
- My mobile number is 9295671120
- My cell is 8786858483
- You can reach me at 7756993412
- mobile number is 9296452144
##intent:goodbye
- bye
- goodbye
- see you around
- see you later
intent:affirm
- yes
- indeed
- of course
- that sounds good
- correct
- ye
- uh yes
- let’s do it
- yeah
- uh yes
- yes knocking
- that’s correct
- yes yes
- right
- yea
- right on
- i love that
intent:deny
- no
- never
- I don’t think so
- don’t like that
- no way
- not really
intent:mood_great
- perfect
- very good
- great
- amazing
- wonderful
- I am feeling very good
- I am great
- I’m good
intent:mood_unhappy
- sad
- very sad
- unhappy
- bad
- very bad
- awful
- terrible
- not very good
- extremely sad
- so sad
intent:bot_challenge
- are you a bot?
- are you a human?
- am I talking to a bot?
- am I talking to a human?
regex:email
- [1]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$
regex:mob_number
- [0-9]{10}
regex:pincode
- [0-9]{6}
-
stories.md
happy path
- greet
- utter_greet_ask
- give_name{“name” : “Baljith”}
- user_info
- form{“name”:“user_info”}
- form{“name”: null}
say goodbye
- greet
- utter_greet_ask
- give_name{“name” : “Baljith”}
- user_info
- form{“name”:“user_info”}
- form{“name”: null}
- goodbye
- utter_goodbye
bot challenge
- greet
- utter_greet_ask
- give_name{“name” : “Baljith”}
- user_info
- form{“name”:“user_info”}
- form{“name”: null}
- bot_challenge
- utter_iamabot
- greet
3.domain.yml
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
intents:
- greet
- give_name
- give_email
- give_pincode
- give_mobile
- goodbye
- affirm
- deny
- mood_great
- mood_unhappy
- bot_challenge
responses:
utter_greet_ask:
- text: "hey there ,whats your name?"
utter_did_that_help:
- text: Did that help you?
utter_goodbye:
- text: Bye
utter_iamabot:
- text: I am a bot, powered by Rasa.
utter_ask_name:
- text: "Your name is?"
- text: "What is your name?"
- text: "Please tell me your name"
- text: "Please enter name."
utter_ask_email:
- text: "Your email is?"
- text: "What is your email id?"
- text: "Please tell me your email id"
- text: "Please enter email id."
utter_ask_pincode:
- text: "Your pincode is?"
- text: "What is your pincode?"
- text: "Please enter your pincode."
- text: "Please tell me your pincode."
utter_ask_mobile:
- text: "Your mobile number is?"
- text: "What is your mobile number?"
- text: "Please enter your mobile number."
- text: "Please tell me your mobile number."
actions:
- utter_greet_ask
- utter_did_that_help
- utter_goodbye
- utter_iamabot
- utter_ask_name
- utter_ask_email
- utter_ask_pincode
- utter_ask_mobile
entities:
- name
- email
- pincode
- mob_number
slots:
name:
type: unfeaturized
email:
type: unfeaturized
pincode:
type: unfeaturized
mob_number:
type: unfeaturized
forms:
- user_info
4.actions.py
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.forms import FormAction
class UserInfo(FormAction):
def name(self) -> Text: """Unique identifier of the form""" return "user_info" @staticmethod def required_slots(tracker: Tracker) -> List[Text]: """A list of required slots that the form has to fill""" return ["name", "email", "pincode", "mob_number"] def slot_mappings(self) -> Dict[Text, Any]: return {"name": self.from_entity(entity="name", intent=["give_name"]), "email": self.from_entity(entity="email", intent=["give_email"]), "pincode": self.from_entity(entity="pincode", intent=["give_pincode"]), "mob_number": self.from_entity(entity="mob_number", intent=["give_mobile"])} def submit(self, dispatcher: CollectingDispatcher, tracker: Tracker, domain: Dict[Text, Any] ) -> List[Dict]: name = tracker.get_slot('name') email = tracker.get_slot('email') pin = tracker.get_slot('pincode') mob = tracker.get_slot('mob_number') # utter submit template dispatcher.utter_message( "Hey, your name is {} , email id : {} , pincode is {} , maobile number is {}".format(name.title(), email.title(), pin.title(), mob.title())) return []
5.config.yml
language: en
pipeline: supervised_embeddings
policies:
- name: MemoizationPolicy
- name: KerasPolicy
- name: MappingPolicy
- name: FormPolicy
6.endpoints.yml
action_endpoint: url: "http://localhost:5055/webhook"
It’s really wierd.I’ve been stuck on this for a long time. I saw Rasa Master class videos and searched the documentation and tried everything.Nothing seems to be working.
Is it because the training examples are less ?? or Am I missing something ?
PS: I am a total newbie, Please Help .
a-zA-Z0-9._%± ↩︎