I'm using dialogflow to let users query for keywords of my product and give them the value of those specific keywords.
But the problem is, when user's search for the synonyms of those keywords, which are already defined in my entity list.
Its HTTP call, returns me the root word, and not the synonym due to which I am not able to find the dropped words.
How do I retrieve the exact word which was fetched?
Please look at the screenshots below for better understanding
Look at the KPIs, as it fetched "Death Rate"
Look at parameters that are fetched, under KPIs, it is fetched as "Mortality"
Screenshot of my entities, Mortality has a synonym "Death Rate"
I need to fetch the exact keyword that is entered
I know, I can put each word in entities, with synonyms apart, but it is too vague for large amount of data. As there is restrictions in number of entities too
To fetch the keywords you just use your returned entities ($entity_name). To fetch the exact synonym matched you use $entity_name.original. What you see at the training phrases is the resolved value but if you check the JSON (from the diagnostic info, bottom right corner, you'll see that the entity that returns is the one defined.
following you example, my entity is named Mortality and one of the synonyms is 'death rate'. You can see the difference between the resolved value and the actual entity name being returned