如何从 Microsoft.Bot.Builder.RecognizerResult 获取列表类型实体的规范化值?

How to get normalized value for List type Entity from Microsoft.Bot.Builder.RecognizerResult?

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

在 BF V3 中,我们有 EntityRecommendation,它的分辨率 属性 我们可以用于此目的,如下所示。

但是我们如何在 V4 中归档相同的目标? Microsoft.Bot.Builder.RecognizerResult 不包含分辨率 属性 而当我们直接查询 LUIS Rest API 时,响应有它。

            EntityRecommendation serviceNameEntityRecommendation;

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

您需要知道返回的实体类型。例如,我通过 "number" 预构建实体创建了一个什么都没有的 LUIS 应用程序。

然后我用了NLP with LUIS Sample

如果我键入 "one thousand",我可以在 recognizerResult.Entities["number"][0] 中检索规范化的“1000”。

这里是 RecognizerResult returns:

的所有内容