RasaHQ / rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants
https://rasa.com/docs/rasa/
Apache License 2.0
18.81k stars 4.62k forks source link

Provide to option to prevent an entity to ever influence rasa core predictions #5751

Closed nbeuchat closed 2 years ago

nbeuchat commented 4 years ago

Description of Problem: Having an option to completely remove an entity from the rasa core prediction would be very helpful to avoid unexpected behaviors for rarely used entities or entities that should just never change the rasa core prediction.

The current recommendation in the documentation suggests adding or removing certain entities to specific intents which is unsatisfactory for entities that should never influence the rasa core prediction. This mean that we need to add ignore_entities: ... to every single intent just to ignore a single entity everywhere.

The second recommendation is to add an unfeaturized slots with the same name which actually but this does not prevent the entity from being featurized for the next action prediction with the current intent.

Doc: https://rasa.com/docs/rasa/core/domains/#ignoring-entities-for-certain-intents

We have had several cases where our production bot failed in the first message because a random entity was detected.

Overview of the Solution: it would be great to be able to configure within the entities section of the domain file if an entity will be used for prediction or not. This could look something like:

entities:

For the prediction, I suppose these entities would just be filtered out completely from the featurizer.

Definition of Done:

MichaelMarien commented 4 years ago

Exalate commented:

MichaelMarien commented:

Should be easy to consolidate such extra attribute in the used_entities property of the intents in domain.py. Would happy to look at this.

sara-tagger commented 4 years ago

Exalate commented:

sara-tagger commented:

Thanks for submitting this feature request

🚀 @erohmensing will get back to you about it soon!
erohmensing commented 4 years ago

Exalate commented:

erohmensing commented:

Hey @nbeuchat, thanks for bringing this up. I think you make a good point about entity featurization causing unexpected behavior in bots. This is something we're aware of and want to fix properly.

Ideally we'd do this by providing better default behavior (e.g. if it were to learn from the stories where entity featurization is actually affecting the prediction, or something of that nature) instead of adding more hacky parameters to the domain file. We're already considering this issue for our next major release (where we can change these defaults significantly).

Ghostvv commented 3 years ago

Exalate commented:

Ghostvv commented:

It is not a research issue, it is an engineering issue of adding fields to domain.yml and read it correctly.

leenaborasahaj commented 3 years ago

Exalate commented:

leenaborasahaj commented:

Hi. I am also facing the same issue. Any update on this? If not how do I handle it with current release (2.3) or 2.2?

indam23 commented 2 years ago

This was made possible in 3.1 - see https://github.com/RasaHQ/rasa/pull/10899