Prevent Duckling from auto-filling slots based on intent

I am using Duckling to extract dates & times from user input in my bot.

By default, any time Duckling can extract a date or time from a message, it does, and saves that to the time slot. Regardless of the intent of the message.

However, sometimes a user will say something like “I’m not sure if I have time today.” In this case, Duckling reads “today” as a date, and sets the time slot as such. When this happens, it messes with some logic I have built for my custom forms and actions.

Is there any way to have Duckling only auto-fill slots for certain intents? i.e. I have an intent called “inform” which is for things like “i’m available at 3pm today”, and I only want Duckling to fill the time slot when a message has the “inform” intent. If a user just happens to use the word “today” or mentions a time in another context, I do not want Duckling to extract & save that to the time slot.

Thanks!

Hi,

I have the same question, does anyone know how to handle this?

Thanks!

I am also struggling with the same. Any help will be highly appreciated. Thanks

Unfortunately there is no implementation where you can filter based on intents.

Fortunately you can always create your custom component

Just copy this extractor code as a custom python file based on the instructions on creating custom components and change this method to escape filter matches if intent is NOT inform

I am not sure if this is a generic enough feature to be included in the main rasa pipeline but you can always customise the implementation to your liking. I do that all the time.