Rasa NLU confusing predictions between 2 intents

I have 2 intents that share an entity. 1 intent has 1 entity and the other has 2 entities

Example phrases:

Intent 1: Show me my deals for [product name]

Intent 2: Show me my [product name] deals for [customer]

With this type of overlap, some entities are succeeding to predict correctly and some are failing. When they fail it’s usually Intent 1 predicted as 2 and vice versa. How do I handle this? It’s pretty evident that intent 1 has 1 entity and intent 2 has 2 entities. However, Rasa does not take that into consideration. I was thinking about adding this separate entity logic myself post-prediction, but that would probably be of poor design and slowly defeats the purpose of using an NLU. What would be the right approach for this? Whenever I add an extra phrase of similar format with different entity values, it’s not necessarily predicting it correctly it seems. It will decrease misprediction of 1 as 2 while increasing the misprediction of 2 as 1.

Hello @bhargavat,

Most likely the best option here would be to combine these into 1 intent and use the slots for verification of the product name and customer. The issue is you have this training data so close to each other it can’t easily distinguish between them.

Otherwise you can setup the 2nd intent but use some different phrasing to keep these away from each other better and not hit issues with classifying the wrong intent.

Let me know if you have further questions on this or if I’m not clear.

Thanks

I know creating different phrases for each other is an option, but given that both aren’t that similar due to the different entities within them, I figured this wouldn’t be an issue. 2nd intent has a high correlation for having 2 entities in it, while the 1st has high correlation with 1 entity only. I was hoping to making my NLU robust to let the user say the 2 phrases mentioned and have it detect it still to make its user experience optimal