Need to grab freeform time period in a slot

(Shruti) #1

HI, My data has time period in multiple formats like- “this month” , “this year” or “March 2016” or “Q1 2016”. What is the best way to grab this info in a single slot? I need to be able to run an sql query with the value stored in this slot.

Any thoughts/suggestions are welcome!

Regards, Shruti

(Souvik Ghosh) #2

use duckling in Rasa -NLU and it will give you entities like time

using this, name a slot called time in rasa_core

the value of time will get filled in the slot coming from Rasa-NLU which is using duckling behind

Here is the documentation

(Shruti) #3

Hi Souvik,

Thanks for the suggestion. I get it that the above method will help capture March 2016, April 2018 etc. But can it also get “this month” , “last month”, “next quarter” etc? or will I need a separate slot for that?

Thank you, Shruti

(Souvik Ghosh) #4

Yes it does, though I am not sure of next quarter

(Shruti) #5

Thanks Souvik. Is there a way I can train it add “next quarter” as a possible value by adding that as a sample value while defining my stories?