0

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?

Rishav
  • 3,818
  • 1
  • 31
  • 49

2 Answers2

0

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.

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • Thanks a ton! I was using the Watson Conversation with the ServiceNow platform to build a chat-bot capable of performing necessary actions based on user's input. The synonyms for a particular entity value were needed for a keyword based search on a specific table in the ServiceNow tool and retrieve relevant data accordingly. In this case the listSynonyms(params,callback()) method of the Conversation API did the trick! – Abhinandan Dasgupta Feb 28 '18 at 20:11
0

Basically you can not extract the synonyms.One thing yiu can do is to create another entity with values as your car names and synonyms as vehicle.So that whenever a vehicle is input it will give you all the entity values.

Rohit
  • 187
  • 6