问题
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
回答1:
Alternate questions can improve the likelihood of a match with a user query. You can try to add that phrase as alternate question to an existing QnA pair.
the QnaThreshold used to perform the queries in Bot's App Settings was set to 0.04
To troubleshoot the issue, you can try to set the ScoreThreshold to 0, then override RespondFromQnAMakerResultAsync
and check the actual QnAMakerResult
returned by QnAMaker service.
回答2:
I see the questions you ask are not exactly the same "donde comprar entradas" <> "donde compro entradas", this could explain some of the differences.
Then, I think that QnA Maker test chat uses some kind of staging environment whereas Azure Bot Chat uses the last published version of the KB.
Are you sure you have published your last changes ?
回答3:
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.
来源:https://stackoverflow.com/questions/50473908/inconsistent-response-between-azure-qnamaker-web-app-bot-and-cognitive-service