首页 > 解决方案 > QnA bot only responds when using exact phrasing in Azure and Teams Chat

问题描述

I created a bot in the Microsoft QnA Maker, and have been testing the QnA pairs in the Maker for a while now. The bot is able to recognize the QnA pairs that I made even if other words are used in the question. However, after introducing the bot to and testing it in both Azure Test Chat and in Teams Chat, I've found that the bot only responds appropriately when using the exact question phrasing.

The bot has a QnA pair where the question is "hello". In QnA Maker Test if I send it variations of this question, such as "hello wicky" or "hello there" then the bot recognizes the pair and responds with the appropriate answer. When testing in Azure and Teams, the bot ONLY responds appropriately if I say "hello". If I say any variations then it just responds with "No good match in FAQ."

My bot has never had problems answering questions that contain other words, but aren't the EXACT question, when testing in QnA Maker. It only seems to be picky when testing in Azure and in Teams. I've republished the bot multiple times, and ensured that the Knowledge Base ID and Subscription Key are correct. What are my options here?

Screenshot of the Azure Test Chat

标签: azureazure-bot-service

解决方案


这是要检查的东西。如果您使用 Bot Service 的起始代码,您可能会从 QnAMakerDialog 继承一个 Dialog。构造函数采用几个参数,包括在没有好的匹配时返回的消息,以及何时返回没有好的匹配文本的最小置信度分数。例如,这是继承自 QnAMakerDialog 的类的构造函数:

 public BasicQnAMakerDialog() : base(new QnAMakerService(new QnAMakerAttribute(Utils.GetAppSetting("QnASubscriptionKey"), Utils.GetAppSetting("QnAKnowledgebaseId"), "No good match in FAQ.", 0.5)))
        {}

请注意,“No good match”文本实际上设置为“No good match in FAQ”,最小置信度得分为 0.5。

如果您签入 QnAMaker 测试聊天,您应该会看到与消息一起返回的置信度分数。您可以尝试降低最低置信度分数以防止收到不匹配的消息。

改进你的机器人

您可以在 QnAMaker 中为您的机器人添加替代短语,然后重新训练并发布模型。洗涤,冲洗,重复。您也可以尝试记录 QnAMaker 返回的置信度分数低于阈值的问题。这将为您的用户提出的问题提供一个起点,因为您的机器人没有很好的答案。

根据您的知识领域,您还可以尝试搜索 Web 并总结最重要的结果,然后将其返回给用户,而不仅仅是“未找到好的匹配项”。这就是 Siri 干涸时所做的事情,这似乎就像我问它的所有问题一样。


推荐阅读