Rasa NLU extract dynamic entity

Hello everyone! I have a question about NLU. Is it able to work with dynamic data?

For example: I have a web interface where I am uploading some files. Those files have names which are set by the user.

So in my RASA bot I have a scenario of file choosing. E.g.

User: select file

Bot: Pls, select file from the list below (and then a set of button with file name [file_name_1, file_name_2, etc]).

User (doesn’t press the button, writes text): I want to choose file_name_1.

Bot: You chose file: file_name_1.

Is it possible to train RASA to extract this entity? Am I right that it is impossible, because i can’t train the model for random file name or maybe there are some workarounds? Because this case looks easy in “determined world”: I have a set of file names in previous message, so I try to find one of these names in current message.

Where do you get the file names in the first place?

From my backend API, where i handle these files

I mean, that i have custom action where i call my api and then send message from this action

There are a few workarounds in this case.

If your filenames has some naming conventions, you can use a regex.

If possible, you can use nltk to filter your sentences and have only the filename left. You’ll need to create a stopwords set for your case. Check this tutorial.

Copy all the names of your files to a table in mysql and use a fulltext-search. Select the name with the highest score.

You can also combine the last two, to get better results.

No, I don’t have any naming conventions, but thank you for other options! I will try the second one.