Commit 0ec3cba2 by Sai Komuravelli

dec 17 flow updates and nlu changes

parent 579ea647
Showing with 41 additions and 50 deletions
...@@ -15,11 +15,12 @@ regex_phone = r"(\d{3}[-\.\s]??\d{3}[-\.\s]??\d{4}\d?|\(\d{3}\)\s*[-]?\d{3}[-\.\ ...@@ -15,11 +15,12 @@ regex_phone = r"(\d{3}[-\.\s]??\d{3}[-\.\s]??\d{4}\d?|\(\d{3}\)\s*[-]?\d{3}[-\.\
import re import re
#extracting email from user entered text
def ExtractEmail(slot_to_fill): def ExtractEmail(slot_to_fill):
email_addresse_list = re.findall('\S+@\S+', slot_to_fill) email_addresse_list = re.findall('\S+@\S+', slot_to_fill)
return email_addresse_list return email_addresse_list
#extracting mobile from user enterd text
def ExtractMobilenumber(slot_to_fill): def ExtractMobilenumber(slot_to_fill):
#phone number extraction #phone number extraction
#regex = re.compile("\+?\d[\( -]?\d{3}[\) -]?\d{3}[ -]?\d{2}[ -]?\d{2}") #regex = re.compile("\+?\d[\( -]?\d{3}[\) -]?\d{3}[ -]?\d{2}[ -]?\d{2}")
...@@ -43,7 +44,7 @@ class greet_primary_information(FormAction): ...@@ -43,7 +44,7 @@ class greet_primary_information(FormAction):
tracker.slots["querytext"] = "stop" tracker.slots["querytext"] = "stop"
return["querytext"] return["querytext"]
else: 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]: 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): ...@@ -77,31 +78,15 @@ class greet_primary_information(FormAction):
print("------------None------------") print("------------None------------")
return {"askques":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]: def validate_email_mobile(self,value:Text,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) -> Dict[Text, Any]:
print('in validate email_mobile') print('in validate email_mobile')
slot_to_fill = value.lower() slot_to_fill = value.lower()
print("email_mobile") print("email_mobile")
print(slot_to_fill) print(slot_to_fill)
mobile_numbers_list=ExtractMobilenumber(slot_to_fill) return {"email_mobile": slot_to_fill ,"availabletime":None , "refferals":"None", "email":"None", "mobilenumber":"None"}
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"}
#validating email using regex
def validate_email(self,value:Text,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) -> Dict[Text, Any]: def validate_email(self,value:Text,dispatcher: CollectingDispatcher,tracker: Tracker,domain: Dict[Text, Any],) -> Dict[Text, Any]:
print('in validate email') print('in validate email')
slot_to_fill = value.lower() slot_to_fill = value.lower()
...@@ -122,11 +107,11 @@ class greet_primary_information(FormAction): ...@@ -122,11 +107,11 @@ class greet_primary_information(FormAction):
print(value) print(value)
if value.lower() in ['yes','yeah','ha','y']: if value.lower() in ['yes','yeah','ha','y']:
print('validate_refferals yes') 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']: elif value.lower() in ['no','No','N']:
print('askques-no') 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: else:
print("------------None------------") print("------------None------------")
return {"refferals":None} return {"refferals":None}
...@@ -136,7 +121,7 @@ class greet_primary_information(FormAction): ...@@ -136,7 +121,7 @@ class greet_primary_information(FormAction):
slot_to_fill = value.lower() slot_to_fill = value.lower()
print(slot_to_fill) print(slot_to_fill)
print(value) 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]]]: def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
return { return {
...@@ -147,7 +132,6 @@ class greet_primary_information(FormAction): ...@@ -147,7 +132,6 @@ class greet_primary_information(FormAction):
"skills": self.from_text(), "skills": self.from_text(),
"availabletime": 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()], "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() "jobtype": self.from_text()
} }
...@@ -169,6 +153,5 @@ class ResetSlot(Action): ...@@ -169,6 +153,5 @@ class ResetSlot(Action):
return "action_reset" return "action_reset"
def run(self, dispatcher, tracker, domain): 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")] 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")]
#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"),
## intent:affirm ## intent:affirm
- correct - correct
- y
- ya
- yaa
- why not
- y not
- ye - ye
- uh yes - uh yes
- let's do it - let's do it
- yeah - yeah
- yup
- yep
- uh yes - uh yes
- um yes - um yes
- yes knocking - yes knocking
...@@ -22,7 +29,18 @@ ...@@ -22,7 +29,18 @@
- do it - do it
- of course - of course
- Yes great - Yes great
- ok
- okay
- i'd love to
- i'd love that
- i'd like to
- i'd like that
## intent:deny ## intent:deny
- n
- na
- nope
- nah
- no - no
- no need - no need
- no thanks - no thanks
...@@ -57,6 +75,8 @@ ...@@ -57,6 +75,8 @@
- halt - halt
- abort - abort
- stop - stop
- get lost
## intent:stop ## intent:stop
......
...@@ -28,7 +28,6 @@ entities: ...@@ -28,7 +28,6 @@ entities:
- mobilenumber - mobilenumber
- response - response
- jobtype - jobtype
- resumeupdate
forms: forms:
- greet_primary_information_form - greet_primary_information_form
...@@ -73,9 +72,6 @@ slots: ...@@ -73,9 +72,6 @@ slots:
jobtype: jobtype:
type: unfeaturized type: unfeaturized
resumeupdate:
type: unfeaturized
availabletime: availabletime:
type: unfeaturized type: unfeaturized
...@@ -108,17 +104,13 @@ templates: ...@@ -108,17 +104,13 @@ templates:
utter_ask_askques: utter_ask_askques:
- custom: - 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: utter_ask_availabletime:
- custom: - 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: utter_ask_refferals:
- custom: - 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​" 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."
utter_sms: utter_sms:
- custom: - custom:
...@@ -126,31 +118,28 @@ templates: ...@@ -126,31 +118,28 @@ templates:
utter_ask_company: utter_ask_company:
- custom: - custom:
text: "What is the curent company you are working for ?" text: "What is the curent company you are working for?"
utter_ask_mobilenumber: utter_ask_mobilenumber:
- custom: - custom:
text: "Please enter your updated mobile number ?" text: "Please enter your updated mobile number?"
utter_ask_email: utter_ask_email:
- custom: - custom:
text: "Please enter your updated email address ?" text: "Please enter your updated email address?"
utter_ask_jobtype: utter_ask_jobtype:
- custom: - custom:
text: "Are you interested in Full time/Contract jobs or in either?" text: "Thanks for the information. Are you interested in Contract, Perm or 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”"
utter_ask_email_mobile: utter_ask_email_mobile:
- custom: - 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: utter_ask_skills:
- custom: - 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: utter_slots_greet_primary_information:
- custom: - custom:
...@@ -161,7 +150,6 @@ templates: ...@@ -161,7 +150,6 @@ templates:
response: '{response}' response: '{response}'
jobtype: '{jobtype}' jobtype: '{jobtype}'
text: "1" text: "1"
resumeupdate: '{resumeupdate}'
availabletime: '{availabletime}' availabletime: '{availabletime}'
utter_stop: utter_stop:
...@@ -179,5 +167,5 @@ templates: ...@@ -179,5 +167,5 @@ templates:
utter_welcome: utter_welcome:
- custom: - 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