Literal Dates (say, 10-Oct-2020) as Entities

Hello Ladies & Gents,

I’m new to RASA . I would like to try it out and maybe propose it as a possible option Chatbot assistant for our organization.

At this moment, the most important usecase for us is a HR Assistant, (Leavel Application, FAQ etc). So far, the features of RASA has been very exciting.

While i begin to understand how the the bot can be trained with examples with entities and their possible values, I’m not very sure to train the bot with dates.

The following training stories are clear to me:

  1. Applying for leave type:
  • I want to apply for annual leave
  • I want to apply for sick leave
  1. Leave with dates as keywords(i understand that duckling needs to be used)

But what should i do for a use case like Take annual leave from 09-15-2020 to 10-15-2020. I cannot possibly enter every possible date as a training example.

My expectation is simply that the bot takes a story path where it has to extract any date that is entered into a entity. Am i missing something here.

Another example would be locations, where the number of locations could be very high (say all the cities of USA), i could not possibly add stories that cover all those cities.

EDIT: I did my search/research, but I could not find anything related to literal dates, but only with relative dates. Hence my post here

Cheers Manoj

I think what you’re looking for is the Duckling Feature Extractor. It’s a component that you can add to the config.yml pipline and it can detect dates using heuristics. I’ve not used it personally yet but my understanding is that it can also fetch relative dates an parse them into absolute dates.

thanks for the reply koaning. I understand that it can extract the dates, but my specific question was on the training part.

While I’m expected to train my bot with all possible values for an entity (in my example, the leave types: annual and sick), I struggle to understand how this can be done with the dates.

When you are using Duckling entity extractor, you don’t need any training data. Rasa will pass every message to Duckling to extract the entities. Duckling will automatically extract all the entities that is present in the input message.

Hm, in this case, how would it know which is which (say if have two dates, one for a from date and one for a to date)

You can use Entity Roles for that. But this will need diet classifer or CEF entity extractor to be used. However, this might take you back to the training data issue.

Duckling can extract multiple dates, you can use a custom action to assign proper meaning to the extracted dates.