# Synonym value recognizition

**URL:** <https://forum.rasa.com/t/synonym-value-recognizition/13302>\
**Category:** Rasa Open Source\
**Created:** [July 22, 2019, 9:40am UTC](https://forum.rasa.com/t/synonym-value-recognizition/13302 "2019-07-22T09:40:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasanth55555](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/prasanth55555/32/3635_2.png) [@prasanth55555](https://forum.rasa.com/u/prasanth55555)\
**Post date:** [July 22, 2019, 9:40am UTC](https://forum.rasa.com/t/synonym-value-recognizition/13302/1 "2019-07-22T09:40:56Z")

</div>

Hey guys is there any way for me to recognise the value passed to the NLU for synonym.My NLU was able to recognise the synonym value but is there any way to find what is the value that has been replaced by the synonym.

@akelad @MartinGentleman @Ghostvv

---

<div class="post-metadata">

**Author:** ![SamS](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sams/32/3497_2.png) [@SamS](https://forum.rasa.com/u/SamS)\
**Post date:** [July 22, 2019, 11:35am UTC](https://forum.rasa.com/t/synonym-value-recognizition/13302/2 "2019-07-22T11:35:50Z")

</div>

Hi, may I first ask what you mean by finding the value? Do you want to just print out or log the original value, or do you actually want to use this information further in the pipeline? Either way, I think that some tinkering with the Entity mapper’s code will be needed.

---

<div class="post-metadata">

**Author:** ![prasanth55555](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/prasanth55555/32/3635_2.png) [@prasanth55555](https://forum.rasa.com/u/prasanth55555)\
**Post date:** [July 22, 2019, 12:55pm UTC](https://forum.rasa.com/t/synonym-value-recognizition/13302/3 "2019-07-22T12:55:06Z")

</div>

Hi @SamS sorry for not properly explaining,what i tried to say is that the nlu i trained was able to identify (audio book) is a synonym of (audio), but i need the value (audio book) for further processing [KIND OFF LOGGING THE ORIGINAL VALUE] is there any way i can get it? thanks

---

<div class="post-metadata">

**Author:** ![SamS](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/sams/32/3497_2.png) [@SamS](https://forum.rasa.com/u/SamS)\
**Post date:** [July 22, 2019, 1:20pm UTC](https://forum.rasa.com/t/synonym-value-recognizition/13302/4 "2019-07-22T13:20:18Z")

</div>

So, the most basic way of printing the original value (perhaps side by side with the new value) could be done by inserting a statement like this just before [this line](https://github.com/RasaHQ/rasa/blob/745821e41e1e1857cb4b85ff4f84d99943469113/rasa/nlu/extractors/entity_synonyms.py#L88):

```auto
print(entity["value"], "=>", self.synonyms[entity_value.lower()])

```

If you also want to show the specific message in which this replacement happened, the message object is available in the [process()](https://github.com/RasaHQ/rasa/blob/745821e41e1e1857cb4b85ff4f84d99943469113/rasa/nlu/extractors/entity_synonyms.py#L40) method.

Does this answer your question?

---

<div class="post-metadata">

**Author:** ![prasanth55555](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/prasanth55555/32/3635_2.png) [@prasanth55555](https://forum.rasa.com/u/prasanth55555)\
**Post date:** [July 22, 2019, 1:58pm UTC](https://forum.rasa.com/t/synonym-value-recognizition/13302/5 "2019-07-22T13:58:28Z")

</div>

Thanks @SamS it perfectly suits my question thank you.
