I have realized that dates and times are hard. I saw that the duckling extractor finds a way to make this a lot easier. I have a forum that creates meetings and it currently checks for date and time entities to make sure it has all the information needed.
Since the duckling extractor does both date and time, how would I make sure that I am able to get both the needed pieces of information. When I try it currently with the duckling extractor applied, i would say " i would like to come in tomorrow" but the forum automatically stops because the extractor sees tomorrow but doesnt ask for a time. I need to be able to follow that message up with âWhat time are you looking to meetâ.
Sorry if that sounded all over the place. If I need to clarify anything, please let me know!
Hey @abhi, you always want to get both date and time info, and the issue is that sometimes only one of these comes at first, right? I have to say that itâd be easier if Duckling could provide date and time separately, but it doesnâtâŚ
Whatâs the exact output from Duckling when it extracts only date info but not time (as in your example)? I wonder if you could have a custom action that would check the extracted info and judge whether itâs both date and time or just one, and perhaps set separate data and time slots. Then, based on which slots are filled, next action could be chosen correctly (if you write stories/rules for this behaviour).
Yes, I would always need to get both the date and the time. In my example, it asks for date first if neither entities are detected in the create_meeting intent. When the bot asks what day would you like to come in, I say âtomorrowâ. This extracts â2021-06-18T00:00:00:00â and assigns it to the time entity (which autofills the time slot) and ends the form without asking for the time. So it captures the date properly but doesnt ask for the time.
How would you go about checking if the extracted info is both a time and day? My best idea would be to check if the time slot had the T00:00:00:00 and base it on that. Is that feasible?
Right, I get you @abhi. I have to say that checking for the T00:00:00:00 in a date-time extracted value is the only easy thing that comes to my mind. Indeed, this could backfire if the user actually specified that time in their utterance, but maybe you donât expect that to happen in your scenario, or you could ask the user to confirm if unsure, or you could use some heuristics to make a reasonable guess, i.e. âdid the userâs message contain the word midnight?â, etc.
That makes sense. I will play around with it see if I can get that to work and also put in some safety in case someone chooses to have a meeting at midnight!