Commit 0ec3cba2 by Sai Komuravelli

dec 17 flow updates and nlu changes

parent 579ea647
Showing with 42 additions and 51 deletions
......@@ -15,11 +15,12 @@ regex_phone = r"(\d{3}[-\.\s]??\d{3}[-\.\s]??\d{4}\d?|\(\d{3}\)\s*[-]?\d{3}[-\.\
import re
#extracting email from user entered text
def ExtractEmail(slot_to_fill):
email_addresse_list = re.findall('\S+@\S+', slot_to_fill)
return email_addresse_list
#extracting mobile from user enterd text
def ExtractMobilenumber(slot_to_fill):
#phone number extraction
#regex = re.compile("\+?\d[\( -]?\d{3}[\) -]?\d{3}[ -]?\d{2}[ -]?\d{2}")
......@@ -43,7 +44,7 @@ class greet_primary_information(FormAction):
tracker.slots["querytext"] = "stop"
return["querytext"]
else:
return["intentname","confidence","querytext" ,"askques","refferals","skills","jobtype", "email_mobile","email", "mobilenumber","resumeupdate", "availabletime","response"]
return["intentname","confidence","querytext" ,"askques","refferals","skills","jobtype", "email_mobile","email", "mobilenumber", "availabletime","response"]
def validate_querytext(self,value:Text,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) -> Dict[Text, Any]:
......@@ -77,31 +78,15 @@ class greet_primary_information(FormAction):
print("------------None------------")
return {"askques":None}
#validating email and phone user can give both or single entity value
def validate_email_mobile(self,value:Text,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) -> Dict[Text, Any]:
print('in validate email_mobile')
slot_to_fill = value.lower()
print("email_mobile")
print(slot_to_fill)
mobile_numbers_list=ExtractMobilenumber(slot_to_fill)
email_addresse_list=ExtractEmail(slot_to_fill)
print('email_addresse_list',email_addresse_list)
print('mobile_numbers_list',mobile_numbers_list)
if mobile_numbers_list == [] or email_addresse_list == []:
print('in empty lists')
if mobile_numbers_list ==[] and email_addresse_list != []:
print('ask mobile')
return {"mobilenumber": None, "refferals" : "None","email": email_addresse_list, "email_mobile":"None" }
elif email_addresse_list ==[] and mobile_numbers_list !=[] :
print('ask email')
return {"email": None, "refferals" : "None" , "mobilenumber" :mobile_numbers_list ,"email_mobile":"None" }
else:
return {"email_mobile": None }
else:
return {"email_mobile": email_addresse_list + mobile_numbers_list ,"resumeupdate":None , "refferals":"None", "email":"None", "mobilenumber":"None"}
print(slot_to_fill)
return {"email_mobile": slot_to_fill ,"availabletime":None , "refferals":"None", "email":"None", "mobilenumber":"None"}
#validating email using regex
def validate_email(self,value:Text,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) -> Dict[Text, Any]:
print('in validate email')
slot_to_fill = value.lower()
......@@ -122,11 +107,11 @@ class greet_primary_information(FormAction):
print(value)
if value.lower() in ['yes','yeah','ha','y']:
print('validate_refferals yes')
return {"refferals":"None","response":" Great! Could you please enter the candidate’s name and phone number in our portal http://app.vsoftconsulting.com/aistaffingprod/referral.html ​so one of our recruiters can contact them. Thank you for your time and have a great day.​","email_mobile":"None", "skills":"None","availabletime":"None","mobilenumber":"none","email":"none","jobtype":"None","resumeupdate":"None"}
return {"refferals":"None","response":"Great! Please enter the candidate’s name and phone number in our portal http://app.vsoftconsulting.com/aistaffingprod/referral.html ​with your reference number. Thank you for your time and Have a great day.","email_mobile":"None", "skills":"None","availabletime":"None","mobilenumber":"none","email":"none","jobtype":"None"}
elif value.lower() in ['no','No','N']:
print('askques-no')
return{"response":"Thank you for your time and have a great day. ​", "email_mobile":"","email":"", "mobilenumber":"", "skills":"","availabletime":"","jobtype":"","resumeupdate":""}
return{"response":"Thank you for your time. Please reach out to recruiter@vsoftconsulting.com with your reference number if you have any questions. Have a great day.", "email_mobile":"","email":"", "mobilenumber":"", "skills":"","availabletime":"","jobtype":""}
else:
print("------------None------------")
return {"refferals":None}
......@@ -136,7 +121,7 @@ class greet_primary_information(FormAction):
slot_to_fill = value.lower()
print(slot_to_fill)
print(value)
return {"response":"Thank you for your time. We will contact you as advised. Have a great day​."}
return {"response":"Thank you. We’ll have a recruiter reach out to you at that time. Please feel free to update your resume at http://app.vsoftconsulting.com/aistaffingprod/uploadresume.html Or if you have any questions please mail to recruiter@vsoftconsulting.com with your reference number"}
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return {
......@@ -147,7 +132,6 @@ class greet_primary_information(FormAction):
"skills": self.from_text(),
"availabletime": self.from_text(),
"refferals":[self.from_intent(intent=["affirm"],value="yes"),self.from_intent(intent=["deny"],value="no"),self.from_text()],
"resumeupdate": self.from_text(),
"jobtype": self.from_text()
}
......@@ -169,6 +153,5 @@ class ResetSlot(Action):
return "action_reset"
def run(self, dispatcher, tracker, domain):
return [SlotSet("email_mobile", None),SlotSet("jobtype", None),SlotSet("resumeupdate", None) , SlotSet("email", None),SlotSet("mobilenumber", None),SlotSet("refferals", None),SlotSet("intentname","empty"),SlotSet("confidence",None), SlotSet("skills",None), SlotSet("askques",None),SlotSet("availabletime",None),SlotSet("querytext","empty")]
#SlotSet("copeup","empty"),SlotSet("sources","empty"), SlotSet("concern","empty"),SlotSet("pressingconcerns","empty"),SlotSet("items","empty"),SlotSet("purchase","empty"),SlotSet("fmembers","empty"),SlotSet("socialmedia","empty"),SlotSet("assistance","empty"),SlotSet("mobilenumber","empty"),
return [SlotSet("email_mobile", None),SlotSet("jobtype", None), SlotSet("email", None),SlotSet("mobilenumber", None),SlotSet("refferals", None),SlotSet("intentname","empty"),SlotSet("confidence",None), SlotSet("skills",None), SlotSet("askques",None),SlotSet("availabletime",None),SlotSet("querytext","empty")]
## intent:affirm
- correct
- y
- ya
- yaa
- why not
- y not
- ye
- uh yes
- let's do it
- yeah
- yup
- yep
- uh yes
- um yes
- yes knocking
......@@ -22,7 +29,18 @@
- do it
- of course
- Yes great
- ok
- okay
- i'd love to
- i'd love that
- i'd like to
- i'd like that
## intent:deny
- n
- na
- nope
- nah
- no
- no need
- no thanks
......@@ -57,6 +75,8 @@
- halt
- abort
- stop
- get lost
## intent:stop
......
......@@ -28,7 +28,6 @@ entities:
- mobilenumber
- response
- jobtype
- resumeupdate
forms:
- greet_primary_information_form
......@@ -73,9 +72,6 @@ slots:
jobtype:
type: unfeaturized
resumeupdate:
type: unfeaturized
availabletime:
type: unfeaturized
......@@ -108,17 +104,13 @@ templates:
utter_ask_askques:
- custom:
text: "This is VERA from V-Soft Consulting Inc (https://www.vsoftconsulting.com ). May I help you in finding your Ideal job or new project ? Please say YES/NO​"
text: "This is VERA from V-Soft Consulting Inc (https://www.vsoftconsulting.com ). It’s been a while since we’ve been in contact with you. Are you interested in hearing about job opportunities that match your background and skills?​Yes/no​"
utter_ask_availabletime:
- custom:
text: "Great! please let us know the most preferred date and time(mm/dd/yyyy hh:mm am/pm) to schedule a call with a recruiter."
text: "We are almost done. When would be the best time for one of our recruiter reach out to you to talk further? Please enter the date and time as in mm/dd/yy and hh:mm am/pm."
utter_ask_refferals:
- custom:
text: "Thank you . It looks like you are not interested in the job opportunities now, but you can search for your ideal job at https://www.vsoftconsulting.com/career-portal/ . Would you like to refer someone who is in the job market? YES/NO​"
utter_deny:
- custom:
text: "0"
response: "Thankyou. It looks like you are not interested in job opportunity now but we will save your resume and contact you if your resume matches a different job postings."
text: "Thank you. It looks like you are not interested in the job opportunities now, but you can search for your ideal job at https://www.vsoftconsulting.com/career-portal/ . Would you like to refer someone who is in the job market? Yes/no"
utter_sms:
- custom:
......@@ -126,31 +118,28 @@ templates:
utter_ask_company:
- custom:
text: "What is the curent company you are working for ?"
text: "What is the curent company you are working for?"
utter_ask_mobilenumber:
- custom:
text: "Please enter your updated mobile number ?"
text: "Please enter your updated mobile number?"
utter_ask_email:
- custom:
text: "Please enter your updated email address ?"
text: "Please enter your updated email address?"
utter_ask_jobtype:
- custom:
text: "Are you interested in Full time/Contract jobs or in either?"
utter_ask_resumeupdate:
- custom:
text: "Thank you, we are almost finished. You can update your latest resume in our portal http://app.vsoftconsulting.com/aistaffingprod/uploadresume.html and say “YES” or you can say “NO”"
text: "Thanks for the information. Are you interested in Contract, Perm or either?​"
utter_ask_email_mobile:
- custom:
text: "Can you please update your email address and mobile number ?"
text: "is this the best email and phone number to reach you? If not please update."
utter_ask_skills:
- custom:
text: "Before we connect you to one of our recruiters, we would like to ask you few questions. What are your top 3-5 technical skills"
text: "Great. We will be happy to help. So, we can talk about relevant opportunities, what are your top 3-5 skillset?​"
utter_slots_greet_primary_information:
- custom:
......@@ -161,7 +150,6 @@ templates:
response: '{response}'
jobtype: '{jobtype}'
text: "1"
resumeupdate: '{resumeupdate}'
availabletime: '{availabletime}'
utter_stop:
......@@ -179,5 +167,5 @@ templates:
utter_welcome:
- custom:
text: "Hi. This is VERA from V-Soft Consulting Inc (https://www.vsoftconsulting.com/). I may help you in finding your Ideal job or new project. Would you like to hear more? Please say YES/NO​"
text: "This is VERA from V-Soft Consulting Inc (https://www.vsoftconsulting.com ). It’s been a while since we’ve been in contact with you. Are you interested in hearing about job opportunities that match your background and skills?​Yes/no​"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment