Confusion in Using Entity Synonyms


(Varun) #1

Hi folks,

I have a confusion in linking the synonyms, values, and the entities. I spent hours on searching for an answer and did not find it. For example, if the bot has 2 entities: City and Cuisine.

For the city entity, I have many values (more than 50) with their synonyms such as :

1- New york and its synonyms are NYC, newyork, New York

2- Los Angelos and its synonyms are LA, Los Angelos, Losangelos

And for the cuisine entity, I have the same case as the city entity:

1- Canadian and its synonyms are Poutine, Butter tarts, Kraft Dinner

2- Italian and its synonyms are Pizza, Basilicata, Calabria, Campania

My question is how can I define the “common examples” and the “entity_synonyms” in the training JSON file?

Do I need to train each intent on the list of the entities and their synonyms? In this case, I will have duplicated records. For example: what is the weather in NYC? what is the weather in New York? what is the weather in LA?

Or, is there a way to train the rasa_nlu intent using one values such as NYC and when a user posed a question including LA (instead of NYC), the nlu will be able to extract it as city entity and the value as “Los Angelos”?

I really appreciate your help :slight_smile: