Slot validation for date

I working with date slot using duckling pipeline. I want to validate the date value because user can give input like todaya or tomorow accidentally like that. In that case, I want to notify the user with some message “Please enter validate date” by validating the date slot. Is there any solution ? Kindly, help me…

@seera if you have such requirement then I dont think there’s any use of Duckling extractor. Duckling should be used if you want to extract exact date from user’s text like today, tomorrow or last sunday etc.

yes, correct. Sometime user give input with spelling mistake like todaya accidentally. In that case, how can i solve

you can keep a check whether you get time entity and it’s value in tracker using tracker.latest_message[‘entities’] in your validate date method . If you dont get it you can return error message.:

post some sample code for that. How to use in form validation. I’m new to rasa

@seera please refer the below code snip

image

If user writes wrong spellings like ‘todaya’ duckling will not be able to extract entity as time and thus will return dateslot as None uttering a message to enter valid date again.

thanks @alkak95

is your problem solved?