How can I extract any word from a sentence where it expects an entity

Hi, so I am making a ChatBot and one of the task it to open google with a search query as per the user input. The user can say: I want to search for cats on google The bot must open a new tab with that google search. The problem is that the user can ask to search for anything on google. So, I created some entity extraction like so:

intent:task_google

As long as the user searches for the above listed, RASA is able to recognize that google query entity has been called. However, let’s say the user said “google Air Canada from Amsterdam to Canada”. RASA does not detect this as an entity. The entity field is empty. So, do I have to add all possible queries as entities or is there a better way to go about this?

Is it an option to do this in a Custom Action? As in only detect the intent and let the custom action filter the users message. You can retrieve it with tracker.latest_message.get('text') You would then remove words like “google”, “search” or “i want” and use the rest as an input for your google search. Not sure if this is a robust solution, but might be worth to try out :slight_smile:

Otherwise an EntityExtractor like the DIETClassifier can learn to extract entities it has not seen before, but you need a significant amount of training data.

Yea, the hardcoded way is the best option I have right now, but I was thinking if it could somehow just detect the google query by understanding the semantic meaning of the sentence. I am probably going to end up doing the hardcoded way anyways.