Synonym value recognizition

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

1 Like

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.

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

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:

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() method.

Does this answer your question?

Thanks @SamS it perfectly suits my question thank you.