你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

使用 QnA Maker 门户添加问题和回答

注意

Azure Open AI On Your Data 利用大型语言模型 (LLM) 生成与 QnA Maker 类似的结果。 如果要将 QnA Maker 项目迁移到 Azure Open AI On Your Data,请查看我们的指南

创建知识库后,添加具有元数据的问题和回答 (QnA) 对,以便筛选回答。 下表中的问题涉及到 Azure 服务限制,但每个问题与不同的 Azure 搜索服务相关。

注意

QnA Maker 服务将于 2025 年 3 月 31 日停用。 问答功能的较新版本现已作为 Azure AI 语言的一部分提供。 有关语言服务中的问答功能,请参阅问答。 从 2022 年 10 月 1 日开始,你将无法创建新的 QnA Maker 资源。 有关将现有 QnA Maker 知识库迁移到问题解答的信息,请参阅迁移指南

问题 Answer 元数据
#1 How large a knowledge base can I create?

What is the max size of a knowledge base?

How many GB of data can a knowledge base hold?
The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details. service=qna_maker
link_in_answer=true
#2 How many knowledge bases can I have for my QnA Maker service?

I selected an Azure Cognitive Search tier that holds 15 knowledge bases, but I can only create 14 - what is going on?

What is the connection between the number of knowledge bases in my QnA Maker service and the Azure Cognitive Search service size?
Each knowledge base uses 1 index, and all the knowledge bases share a test index. You can have N-1 knowledge bases where N is the number of indexes your Azure Cognitive Search tier supports. service=search
link_in_answer=false

将元数据添加到 QnA 对之后,客户端应用程序可以:

  • 请求仅与特定元数据匹配的回答。
  • 接收所有回答,但根据每个回答的元数据对回答进行后处理。

先决条件

登录到 QnA Maker 门户

  1. 登录到 QnA Maker 门户

  2. 选择来自上一个快速入门的现有知识库。

添加其他采用替代句式的问题

当前知识库具有 QnA Maker 故障排除 QnA 对。 这些对是在创建过程中向知识库添加 URL 时创建的。

导入此 URL 后,只创建了具有一种回答的一个问题。 在此过程中添加其他问题。

  1. 在“编辑”页上,使用问题和回答对上方的搜索文本框查找问题 How large a knowledge base can I create?

  2. 在“问题”列中,选择“+ 添加替代句式”,然后添加下表中提供的每种新句式。

    替代句式
    What is the max size of a knowledge base?
    How many GB of data can a knowledge base hold?
  3. 选择保存并训练以重新训练知识库。

  4. 选择“测试”,然后输入一个与新替代句式接近、但措辞不完全相同的问题:

    What GB size can a knowledge base be?

    正确的回答将以 markdown 格式返回:

    The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](../concepts/azure-resources.md) for more details.

    如果在返回的回答下选择“检查”,可以查看与问题相符、但置信度级别不一样高的其他回答。

    不要添加替代句式的每种可能组合。 当启用 QnA Maker 的主动学习后,可以查找能够最好地帮助知识库符合用户需求的替代句式。

  5. 再次选择“测试”关闭测试窗口。

添加用于筛选回答的元数据

将元数据添加到问题和回答对可让客户端应用程序请求筛选的回答。 此筛选器将在应用第一个和第二个排名器之前应用。

  1. 此快速入门的第一个表格中,添加不具有元数据的第二个问题和回答对,然后继续执行以下步骤。

  2. 依次选择“视图选项”、“显示元数据”。

  3. 对于刚刚添加的 QnA 对,选择“添加元数据标记”,然后添加名称 service 和值 search。 它将如下所示:service:search

  4. 添加名为 link_in_answer 且值为 false 的另一个元数据标记。 它将如下所示:link_in_answer:false

  5. 在表 How large a knowledge base can I create? 中搜索第一个回答。

  6. 为相同的两个元数据标记添加元数据对:

    link_in_answer : true
    service: qna_maker

    现在,有两个问题具有相同的元数据标记,但这些标记的值不同。

  7. 选择保存并训练以重新训练知识库。

  8. 选择顶部菜单中的“发布”转到“发布”页。

  9. 选择“发布”按钮,将当前知识库发布到终结点。

  10. 发布知识库后,继续学习下一个快速入门,了解如何从知识库生成回答。

你完成了哪些操作?

你已编辑了你的知识库来支持更多问题,并提供了名称/值对以在搜索最佳回答时或者在返回回答后进行后处理时支持筛选。

清理资源

如果你不继续学习下一个快速入门,请在 Azure 门户中删除 QnA Maker 和 Bot 框架资源。

后续步骤