Commit 1fa643af by Rajeev Uppala

duckling extraction code added

parent ad82ce6f
Showing with 10 additions and 4 deletions
...@@ -161,7 +161,9 @@ class greet_primary_information(FormAction): ...@@ -161,7 +161,9 @@ class greet_primary_information(FormAction):
print(value) print(value)
print("OUT") print("OUT")
try: try:
matchedDate = value timeentity=tracker.events[-1]['parse_data']['entities'][0]['value']
matchedDate = datetime.strptime(timeentity, "%Y-%m-%dT%H:%M:%S.000+00:00").strftime('%Y-%m-%d %H:%M:%S')
print("matchedDate",matchedDate)
# Since both the fields are populated, the form # Since both the fields are populated, the form
# will no longer prompt the user separately for the end_date # will no longer prompt the user separately for the end_date
print("Validate available time try") print("Validate available time try")
...@@ -187,8 +189,8 @@ class greet_primary_information(FormAction): ...@@ -187,8 +189,8 @@ class greet_primary_information(FormAction):
def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]: def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
print("type of self from text",type(self.from_text())) # print("type of self from text",type(self.from_text()))
print("self from text",self.from_text()) # print("self from text",self.from_text())
return { return {
"askques": [self.from_intent(intent=["affirm"],value="yes"),self.from_intent(intent=["deny"],value="no"),self.from_text()], "askques": [self.from_intent(intent=["affirm"],value="yes"),self.from_intent(intent=["deny"],value="no"),self.from_text()],
"email_mobile": self.from_text(), "email_mobile": self.from_text(),
......
...@@ -28,6 +28,7 @@ entities: ...@@ -28,6 +28,7 @@ entities:
- mobilenumber - mobilenumber
- response - response
- jobtype - jobtype
- time
forms: forms:
- greet_primary_information_form - greet_primary_information_form
...@@ -93,8 +94,11 @@ slots: ...@@ -93,8 +94,11 @@ slots:
refferal_yes_info: refferal_yes_info:
type: unfeaturized type: unfeaturized
time:
type: unfeaturized
templates: templates:
utter_slots_datetime: utter_slots_datetime:
- custom: - custom:
......
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