【问题标题】:Is there any way to specify order of alternate questions in QnA pair (QnA Maker)?有什么方法可以指定 QnA 对(QnA Maker)中替代问题的顺序?
【发布时间】:2020-03-20 16:05:21
【问题描述】:

我正在使用 QnA Maker 服务以及通过 explicit feedback 进行的主动学习功能,其工作原理如下:查询 QnA Maker,查找模棱两可的问题/答案对,通过从每个问题中选择 第一个问题 来创建英雄卡QnA 对 (QnAMakerResult) 并将其发送给用户。

由于我使用这种逻辑,我希望在 QnA 对 中拥有最好看的第一个问题。但是我发现,当我在 QnA Maker 门户中单击 Save and Train 时,它将覆盖我在 qna 对中的替代问题的顺序,这完全破坏了主动学习体验,因为 qna 对中的某些问题不是那么用户友好,例如只有特定的关键字等

有没有办法为此目的标记一些替代问题(例如标记最用户友好的问题)或禁用 QnA Maker 中的这种自动排序?

【问题讨论】:

    标签: botframework qnamaker


    【解决方案1】:

    由于您没有指定语言,我的回答是指 C# SDK,但这些概念应该可以转移到其他 SDK。

    我相信您可以通过迂回和手动的方式实现您想要的功能:

    1. 在 QnA Maker 门户 add a metadata property 中,对于您要消除歧义的问题,它可能有键 disambiguation-question,值将是您要用于消除歧义的问题。 here 提供了一个示例。例如disambiguation-question: My question that I want to use to disambiguate.
    2. 保存、培训和发布您的知识库。
    3. 更新您的代码以过滤QueryResult 类的Metadata 属性,该类包含Metadata 对象的数组。 GetAnswersAsyncmethod which is how you query your QnA Maker endpoint, will return an array ofQueryResult` 对象。
    4. 使用元数据对象中的Value 在您的卡片中显示以消除歧义。有一个例子说明如何做到这一点here

    还有一个关于 QnA Maker 排名系统如何工作的概述here,目前它的工作原理如下:

    | Step  | Purpose |
    | --- | --- |
    | 1 | The client application sends the user query to the GenerateAnswer API |
    | 2 | QnA Maker preprocesses the user query with language detection, spellers, and word breakers. |
    | 3 | This preprocessing is taken to alter the user query for the best search results. |
    | 4 | This altered query is sent to an Azure Cognitive Search Index, which receives the top number of results. If the correct answer isn't in these results, increase the value of top slightly. Generally, a value of 10 for top works in 90% of queries. |
    | 5 | QnA Maker uses syntactic and semantic based featurization to determine the similarity between the user query and the fetched QnA results. |
    | 6 | The machine-learned ranker model uses the different features, from step 5, to determine the confidence scores and the new ranking order. |
    | 7 | The new results are returned to the client application in ranked order. |
    
    Features used include but aren't limited to word-level semantics, term-level importance in a corpus, and deep learned semantic models to determine similarity and relevance between two text strings.
    

    我希望这会有所帮助。

    【讨论】:

    • 是的,这听起来很有帮助,谢谢(排名系统链接和带有元数据标签的想法)。
    • 没问题@User5468622,您应该发布您最终使用的解决方案,以及在此过程中做出的任何决定作为答案,以防其他人想在未来。 :-)
    • 我会采用你建议的策略。我将创建特殊的元数据属性,例如 user-friendly-question/disambiguation-question,它将包含可用于主动学习的 qna 对的用户友好问题。但由于我们的知识库现在有大约 100 个 QnA 对,而且有人可能忘记将此标签添加到新的 QnA 对中,如果元数据属性 user-friendly-question 缺失,我将使用 QnAMakerResult 中的第一个问题作为默认值。
    猜你喜欢
    • 1970-01-01
    • 2020-06-04
    • 1970-01-01
    • 2019-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-11-24
    • 2020-09-19
    相关资源
    最近更新 更多