Intent based entity extraction

Is there a way in rasa Nlu to extract the entities after intent classification? I realise that intent classification and entity extraction happen independently of each other but in certain cases rasa is giving me the entity that doesn’t belong to that particular intent. For example, in ‘Mr.X is your Driver’ and ‘Mr.Y is your delivery partner’ Mr.Y is being recognised as driver_name instead of delivery_partner_name. Is there a way to localise the entities to specific intents?

You can do it with custom actions.

Use the same entity for extraction, (let’s say person) and in the “… is your driver” intent, call a custom action that sets a driver slot from the person, and in your “… is your delivery partner”, call a custom action that sets a delivery_partner slot from the person entity.