I need to extract all the synonym values for a particular entity. For example, I have an entity named Vehicle
with values Car
and Bus
. For Car
I have three synonyms, Mercedes
,Volvo
and Audi
. Now what I need is when the entity Vehicle
is detected in the user input for a value Car
, I want to extract all the three synonym values present for Car
. I know @Vehicle.literal
will return the exact synonym value detected in the user input. But how can I retrieve all the synonyms for a particular entity value?
You can use the Conversation API to get information on an entity and its metadata. That information is not available in a dialog context itself.
IMHO a better way would be to use a database or similar to match up the detected entity with a list of synonyms. Usually, Conversation service is not used on its own, but part of a solution. The app server could perform the lookup if flagged. Take a look at the dialog actions for that. Or this suggestion on using the method of replaced markers in an answer.