[英]How to extract the synonym values from an entity in Watson Conversation
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
. 例如,我有一个名为
Vehicle
的实体,其值为Car
和Bus
。 For Car
I have three synonyms, Mercedes
, Volvo
and Audi
. 对于
Car
我有三个同义词: Mercedes
, Volvo
和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
. 现在,我需要的是实体时,
Vehicle
在一个值的用户输入检测Car
,我想提取所有在场的三个代名词值Car
。 I know @Vehicle.literal
will return the exact synonym value detected in the user input. 我知道
@Vehicle.literal
将返回在用户输入中检测到的确切同义词值。 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 . 您可以使用Conversation API 获取有关实体及其元数据的信息 。 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 .
或关于在答案中使用替换标记的方法的建议。
基本上,您不能提取同义词。yiu可以做的一件事是创建另一个实体,该实体的值是您的汽车名称,同义词是车辆。因此,每当输入车辆时,它就会为您提供所有实体值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.