How to account for entities not defined in nlu.yml

Hello Rasa community,

I’ve just gotten introduced to Rasa recently and have been trying to build this really basic bot as a starter project. The idea is that the user can type in either the name of a company or a ticker symbol and the bot will return the price through a backend API call.

The custom action for that in actions.py is working completely fine, but the only thing that isn’t working is when I put in a stock that isn’t defined as one of the entities in the examples in nlu.yml. I heard using regex can fix that problem in other cases but won’t work here since there isn’t one consistent pattern that the user will put in. Is there a way to train the model to learn how to predict entities other than the ones in nlu.yml, or should I use a completely different approach?

Thank you!

Hi @jonamhsuya

You can try the lookup table approach by listing down all stock names. Lookup Tables

@siriusraja, thank you so much for your response. I had thought of that before, but wouldn’t it be too tedious to list all stock names since there are thousands of them traded in just the US?

@jonamhsuya This approach is bit robust.

The other way I can think of is to capture the response as text and validate it against the list of stock names before calling the API.

1 Like

Okay, thank you for the help!