简体   繁体   English

QnA机器人仅在Azure和团队聊天中使用精确措词时才响应

[英]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. 我在Microsoft QnA Maker中创建了一个漫游器,并且已经在Maker中测试QnA对已有一段时间了。 The bot is able to recognize the QnA pairs that I made even if other words are used in the question. 即使问题中使用了其他单词,该机器人也能够识别我所做的QnA对。 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. 但是,在将漫游器引入并在Azure Test Chat和Teams Chat中对其进行测试之后,我发现该漫游器仅在使用确切的问题措词时才做出适当的响应。

The bot has a QnA pair where the question is "hello". 该机器人有一个QnA对,问题是“你好”。 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. 在QnA Maker测试中,如果我向其发送此问题的变体,例如“ hello wicky”或“ hello there”,则该漫游器会识别该配对并作出适当的回答。 When testing in Azure and Teams, the bot ONLY responds appropriately if I say "hello". 在Azure和团队中进行测试时,如果我说“你好”,则该漫游器只会做出适当的响应。 If I say any variations then it just responds with "No good match in FAQ." 如果我说有任何变化,那么它会回答“在FAQ中没有很好的匹配”。

My bot has never had problems answering questions that contain other words, but aren't the EXACT question, when testing in QnA Maker. 在QnA Maker中进行测试时,我的机器人在回答包含其他单词的问题时从来没有遇到问题,但不是精确问题。 It only seems to be picky when testing in Azure and in Teams. 在Azure和Teams中进行测试时,它似乎只是很挑剔。 I've republished the bot multiple times, and ensured that the Knowledge Base ID and Subscription Key are correct. 我已经多次重新发布该漫游器,并确保知识库ID和订阅密钥正确。 What are my options here? 我在这里有什么选择?

Screenshot of the Azure Test Chat Azure测试聊天的屏幕截图

Here's something to check. 这是要检查的东西。 If you're using the starter code for Bot Service, you're likely inheriting a Dialog from QnAMakerDialog. 如果您正在使用Bot Service的入门代码,则可能是从QnAMakerDialog继承了一个Dialog。 The constructor takes several params, including a message to return when there's no good match, and a minimum confidence score for when to return the no good match text. 构造函数采用了几种参数,包括一条消息,指出在没有良好匹配时返回的信息,以及一条最小的置信度分数,以指示何时返回没有良好匹配的文本。 For example, here's the constructor for my class that inherits from QnAMakerDialog: 例如,这是我的类的构造函数,该构造函数继承自QnAMakerDialog:

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

Notice that the "No good match" text is actually set to "No good match in FAQ", and the minimum confidence score is 0.5. 请注意,“否很好匹配”文本实际上设置为“ FAQ中没有很好匹配”,并且最低置信度得分是0.5。

If you check in your QnAMaker test chat, you should see the confidence score returned along with the message. 如果您签入QnAMaker测试聊天,您应该会看到返回的置信度分数以及该消息。 You can try lowering the minimum confidence score to prevent getting the no good match message. 您可以尝试降低最低置信度得分,以防止收到不匹配信息。

Improving your bot 改善您的机器人

You can add alternate phrases to the questions in QnAMaker for your bot, then retrain and publish the model. 您可以在机器人的QnAMaker中向问题中添加替代短语,然后重新训练并发布模型。 Wash, rinse, repeat. 洗涤,漂洗,重复。 You may also try logging questions where QnAMaker returns a confidence score below a threshold. 您也可以尝试记录问题,其中QnAMaker返回的置信度得分低于阈值。 That'll give you a starting point for questions that your users are asking where your bot doesn't have a great answer. 这将为您提供一个问题的起点,这些问题是用户在询问您的机器人在哪里没有好的答案的问题。

Depending on what your knowledge domain is, you might also try searching the web and summarizing the top result, then returning that to the user instead of just "No good match found." 根据您的知识领域,您还可以尝试在网络上搜索并汇总最佳结果,然后将其返回给用户,而不只是“找不到合适的匹配项”。 That's what Siri does when it comes up dry, which seems like the case with just about everything I ask it. 这是Siri变干时所做的,这几乎满足了我所要求的所有情况。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM