是否有可能忽略或停止在Microsoft LUIS中的话语(单/双)引号内识别实体?

问题描述 投票:0回答:1

我正在使用MS LUIS构建聊天机器人。当文件名出现在问题中时,它会检测文件名上的名称,日期,数字作为实际实体,而不是。文件名显然是在引号内。仍然LUIS将这些作为实体。

有没有办法告诉LUIS停止将引号内的单词识别为实体。任何帮助将不胜感激。

c# azure luis
1个回答
1
投票

不幸的是,LUIS绑定了所有可能的实体,并且无法有选择地删除它们 - 它们只能从应用程序中完全删除。

但是,您可以通过几种不同的方式在代码中处理此问题:

Ignore the entities

当结果从LUIS返回时,您可以选择性地查看实体。伪代码可能是这样的

// If turnContext.activity.Text doesn't contain "", do something with entities

Selectively send text to LUIS to be recognized

如果您根本不希望LUIS处理文件名,您也可以在代码中忽略它们。代码将是这样的:

var recognizerResult = {};
if (!turnContext.activity.Text.contains("/"))
{
    recognizerResult = await _services.LuisServices[LuisKey].RecognizeAsync(turnContext, cancellationToken);
}

Ignore it in the UI

将切换到实体视图右上角切换到标记视图

enter image description here

enter image description here

Add a new RegEx entity called filepath that eclipses the other entities

实体正则表达式:^(.*/)([^/]*)$

之前:

enter image description here

之后(注意:我只为“/”注册而不是“\”):

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.