Azure QnAMaker Web App Bot与认知服务之间的响应不一致 [英] Inconsistent response between Azure QnAMaker Web App Bot and Cognitive Service

查看:66
本文介绍了Azure QnAMaker Web App Bot与认知服务之间的响应不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对针对查询QnAMaker实例的Azure Web App Bot服务执行的问题(西班牙语)的回答与针对该实例的特定QnAMaker服务直接执行的查询的回答存在差异.

对于这种特定情况,我在Bot的Web聊天和QnAMaker测试聊天中执行了相同的问题.在Bot的网络聊天中检索到的多个响应中,我得到了默认消息(例如,如果问题与答案不符),而在QnAMaker测试聊天中检索的响应中,则得到了知识库中的答案.

在截图下方找到两个聊天的结果:

Bot的网络聊天回复: 批量聊天屏幕截图01 批量聊天屏幕截图02

QnAMaker测试聊天回复: QnAMaker聊天截图01 QnAMaker聊天截图01

已检查将QnAMaker服务与Bot集成的整个配置,并且看起来不错.甚至,在Bot的应用程序设置"中用于执行查询的QnaThreshold也设置为0.04(匹配率为4%),以确保结果不被过滤.

我想问题是Bot模块针对QnAMaker服务构建POST请求的配置差异.

任何人都可以帮助我解决此问题,以确保Bot执行的请求与QnAMaker测试聊天所执行的请求相同,并通过两个聊天获得相同的结果.

谢谢

解决方案

问题已解决. 该问题是由应用设置"变量的数据类型产生的.这些值是在IBM852中编码为process.env对象的字符串,当Javascript将它们转换为float或integer类型时,生成的值不正确. 在app.js中使用应用程序设置变量之前应用parseFloat()或parseInt()之类的相应转换函数将解决此问题.

感谢Microsoft的Web应用程序支持工程师Tyrel Roesler帮助我发现了问题.

I'm having differences with the responses to my questions (in Spanish language) performed against an Azure Web App Bot service that queries to an instance of QnAMaker and the queries directly performed against the specific QnAMaker service for that instance.

For this specific case I've performed the same questions on the Bot's Web Chat and on the QnAMaker Test Chat. In several responses retrieved by the Bot's Web Chat I get the default message (like if the question does not match an answer) while in the responses retrieved by the QnAMaker Test Chat I get an answer matched in the Knowledge Base.

Find below the screenshots with the results on both chats:

Bot's Web Chat responses: Bot Chat Screenshot 01 Bot Chat Screenshot 02

QnAMaker Test Chat Responses: QnAMaker Chat Screenshot 01 QnAMaker Chat Screenshot 01

The entire configuration to integrate the QnAMaker service with the Bot was checked and it looks OK. Even, the QnaThreshold used to perform the queries in Bot's App Settings was set to 0.04 (4% match) to ensure the results are not filtered.

I guess the problem is a configuration difference between the Bot's module that builds the POST request against the QnAMaker service.

Could anyone help me to fix this to ensure the request performed by the Bot is the same than the one performed by the QnAMaker Test Chat and get the same results through both chats.

Thanks

解决方案

The issue is already solved. The problem was generated by the data type of the App Settings variables. These values are strings encoded in IBM852 into the process.env object and when Javascript convert them into float or integer types the generated values are not correct. Applying the respective conversion functions like parseFloat() or parseInt() before using the app settings variables in app.js will solve the problem.

Thanks Tyrel Roesler, Web App Support Engineer from Microsoft, for helping me to discover the problem.

这篇关于Azure QnAMaker Web App Bot与认知服务之间的响应不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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