Confusion in Using Entity Synonyms

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:

2 Likes

I also want an answer to this.

I have a combinatorial explosion of intents since the entities in my intent can take many values (for example, it could be a bunch of product names, each with their own synonyms).

This large number of training examples in one intent is causing a large imbalance which causes other intents to no longer be recognized (see NLU and class impallance).

What is the correct solution here?