如何从Microsoft.Bot.Builder.RecognizerResult获取列表类型实体的规范化值? [英] How to get normalized value for List type Entity from Microsoft.Bot.Builder.RecognizerResult?

查看:93
本文介绍了如何从Microsoft.Bot.Builder.RecognizerResult获取列表类型实体的规范化值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在尝试利用LUIS从用户输入中获取给定同义词的标准化值.

We're trying to leverage LUIS to get normalized value for a given synonyms from the user input.

在BF V3中,我们有

In BF V3, we have the EntityRecommendation, and it has the Resolution property we can use for this purpose, like below.

但是我们如何在V4中归档相同的目标?当我们直接查询LUIS Rest API时,Microsoft.Bot.Builder.RecognizerResult不包含Resolution属性,

But how do we archive the same goal in V4? the Microsoft.Bot.Builder.RecognizerResult does not contain the Resolution property while when we directly query LUIS Rest API, the response has it.

            EntityRecommendation serviceNameEntityRecommendation;

            if (luisResult.TryFindEntity("ServiceNames", out serviceNameEntityRecommendation))
            {
                if (serviceNameEntityRecommendation != null)
                {
                    var resolutions = serviceNameEntityRecommendation.GetResolutions();

推荐答案

您需要知道要返回哪种实体类型.例如,我创建了一个LUIS应用,该应用没有通过数字"预建实体创建任何东西.

You'll need to know what entity type is being returned. For example, I created a LUIS App with nothing by the "number" pre-built entity.

然后,我使用了 NLP LUIS Sample

如果键入一千",则可以在recognizerResult.Entities["number"][0]中检索归一化的"1000".

If I type "one thousand", I can retrieve the normalized, "1000" in recognizerResult.Entities["number"][0].

这是RecognizerResult返回的所有内容:

这篇关于如何从Microsoft.Bot.Builder.RecognizerResult获取列表类型实体的规范化值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆