I am trying to extract the date from the user input in my bot, for example:
U : What is the sales in the store1234 last year?
B : The total sales of the store1234 last year was 123456
In order to achieve this I have designed the bot with the intent - sales and entities : store_id , date.
For handling date I have used duckling as well, so the the values are getting extracted properly but since there is only the initial value of date when the user query by last year. It assign the date entity as 01-01-2017. I am trying to calculate the last date using the duckling which gives the additional information as ‘grain’ : ’ year '. So using this I can calculate my date2 as date1 + 364 .
I am trying to handle these in my custom action file. I am able to retrieve the date slot value which is just the 01-01-2017.
How can I solve this problem?
Any help would be really appreciated.