# Entity Synonyms Confusion

**URL:** <https://forum.rasa.com/t/entity-synonyms-confusion/3787>\
**Category:** Rasa Open Source\
**Created:** [December 21, 2018, 7:34pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787 "2018-12-21T19:34:07Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![varton](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@varton](https://forum.rasa.com/u/varton)\
**Post date:** [December 21, 2018, 7:34pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/1 "2018-12-21T19:34:07Z")

</div>

Hi Rasa folks,

I have 3 entities and for each entity, I have a list of defined items. I used the lookup table but I did not get good results in spite of all of the mentioned entities in the user utterances are exist in the tables. Therefore, I want to check the performance of the synonyms features.

In my bot, I have an entity called cities which includes the city name and its synonyms. For examples

- **Value:** New York , **Synonyms:** NYC and newyork
- **Value:** Los Angelos , **Synonyms:** LA and losangelos

My question is: do I need to include all the entity values or their synonyms in the training data? For example: book me a ticket to nyc reserve me a ticket to New York . . . .

Do I need to include the ‘Los Angelos’ in the training set in order to define the entity name? Or is there something missing me?

Looking forward to your replies 🙂

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 2, 2019, 3:37pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/2 "2019-01-02T15:37:25Z")

</div>

I’m not sure, I understood correctly, what you mean. synonyms are used to override the value of the picked entity after `ner`, in order to increase performace it is better to include as many possible variations as possible

---

<div class="post-metadata">

**Author:** ![varton](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@varton](https://forum.rasa.com/u/varton)\
**Post date:** [January 2, 2019, 7:27pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/3 "2019-01-02T19:27:51Z")

</div>

Thanks @Ghostvv for your reply.

Let me rephrase the problem, I have 2 entities: 1- CityNames 2- Dishes.

Initially, I used the lookup table features since I have a specific list of the defined entities. Unfortunately, the results were not that good ☹

Therefore, I switched to use the Synonyms entity. For example, in the CityName entity I have the following:

- **Value:** New York , **Synonyms:** NYC and newyork
- **Value:** Los Angelos , **Synonyms:** LA and losangelos . . .

My question in the training set, do I need to include all the cities for all the values (e.g. nyc and LA …etc. )? If yes, then the list of utterances in the training for the intents that include CityName entity will be greater than those intents without entities. Consequently, the model will be biased? I hope I clarified the issue

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 3, 2019, 12:37pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/4 "2019-01-03T12:37:53Z")

</div>

There is no definite rule. Different things should be tried

---

<div class="post-metadata">

**Author:** ![varton](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@varton](https://forum.rasa.com/u/varton)\
**Post date:** [January 4, 2019, 2:19am UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/5 "2019-01-04T02:19:20Z")

</div>

Thanks again @Ghostvv for your reply.

But if I am going to train the model for the synonyms of all values that I have, most probably I will get an overfitted model. Does this sound correct or there is something missing me?

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 4, 2019, 9:42am UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/6 "2019-01-04T09:42:03Z")

</div>

might be, but if you are going to include `all` values, there is nothing left to `over`fit to. It is better to try it first, before making hypothetical conclusions

---

<div class="post-metadata">

**Author:** ![varton](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@varton](https://forum.rasa.com/u/varton)\
**Post date:** [January 7, 2019, 6:22pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/7 "2019-01-07T18:22:12Z")

</div>

@Ghostvv I trained the model on 13 intents. 9 of them have the cityNames as entity. So, I trained the model on all intents. And, for those intents that had cityNames as entity, I included all the values (with their synonyms) in the training set. For example,

- “book a ticket to LA” (and I list all the synonyms of LA)
- “book a ticket to NYC” (and I list all the synonyms of NYC)
- “book a ticket to FL” (and I list all the synonyms of FL) and so on

When I tested the model, it was too biased because the training set of those intents (that had the CityNames entities) are large since their examples are duplicated except for the entity (in order to include all the cityNames values) as shown in the example above.

So, is there anything missed me?

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 8, 2019, 9:52am UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/8 "2019-01-08T09:52:03Z")

</div>

in `json` format you can provide examples without intents

---

<div class="post-metadata">

**Author:** ![varton](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@varton](https://forum.rasa.com/u/varton)\
**Post date:** [January 8, 2019, 9:20pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/9 "2019-01-08T21:20:21Z")

</div>

I was unaware that I can provide examples without intents. Is there a link showing how to do this? I am unable to find it in [Training Data Format](https://rasa.com/docs/nlu/dataformat/)

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 9, 2019, 8:46am UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/10 "2019-01-09T08:46:22Z")

</div>

[Training Data Format](https://rasa.com/docs/nlu/dataformat/#common-examples) Just do not provide `intent` key

---

<div class="post-metadata">

**Author:** ![varton](https://avatars.discourse-cdn.com/v4/letter/v/4491bb/32.png) [@varton](https://forum.rasa.com/u/varton)\
**Post date:** [January 9, 2019, 10:08pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/11 "2019-01-09T22:08:18Z")

</div>

Many thanks @Ghostvv, I will try it and get back to you.

---

<div class="post-metadata">

**Author:** ![Nermeen](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@Nermeen](https://forum.rasa.com/u/Nermeen)\
**Post date:** [March 4, 2021, 2:42pm UTC](https://forum.rasa.com/t/entity-synonyms-confusion/3787/12 "2021-03-04T14:42:12Z")

</div>

Hello @varton

I am facing the same exact situation… have you find a solution for listing those entities in the training data?
