Slot validation for date - Rasa Open Source - Rasa Community Forum

Slot validation for date

post by seera on Sep 25, 2020

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…


post by alkak95 on Sep 25, 2020

@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.


post by seera on Sep 25, 2020

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


post by alkak95 on Sep 29, 2020

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 by seera on Oct 1, 2020

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


post by alkak95 on Oct 8, 2020

@seera please refer the below code snip

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.


post by seera on Oct 10, 2020

thanks @alkak95


post by ishubham4 on Nov 12, 2021

is your problem solved?