How to handle for entity which are dynamic?

Suppose instead of a fixed entity , let’s say book name, we have dynamic book names.

How get_slot for entity name which are dynamic?

What I mean by that is:

Let’s say user says: I want to know what is name of author of Harry Pottar.

This book name cannot be fixed as number of book in db increases each day.

Now I have created API which based on book’s name, will give response of author name which I am fetching from actions.py.

So since my bot is not trained upon dynamic name, how can it recognize that it needs to pick book name - Harry Pottar and set slot Harry Pottar and fetch API, get response from API and provide response to user in bot.

If anyone needs any further information please let me know.

1 Like

You can do this today by training a DIET entity extractor. Make sure you have enough annotations for the entity example (try for at least 20).

Then make your slot type any or text to store in that slot anything that comes back from the entity.

Hi @Vikrant,

You can try with build in entities. Try with spacy entity extractor. Go through the document for spacy entity extractor. Mention this entity extractor in config file and then you can use its predefined entities like loc, person.

And if the entities are build in then in domain file define it. In entities with the same name as slot name.