Skip to content

Commit a5fcc1d

Browse files
Merge pull request #103722 from diberry/diberry/qna-quickstart-portal
[Cogsvcs] Qna - Portal Quickstarts
2 parents 72cb466 + d4da6ab commit a5fcc1d

19 files changed

+897
-464
lines changed

.openpublishing.redirection.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,11 @@
970970
"redirect_url": "/azure/cognitive-services/LUIS/luis-how-to-azure-subscription",
971971
"redirect_document_id": false
972972
},
973+
{
974+
"source_path": "articles/cognitive-services/QnAMaker/Tutorials/create-publish-answer.md",
975+
"redirect_url": "/azure/cognitive-services/QnAMaker/quickstarts/create-new-kb-csharp",
976+
"redirect_document_id": false
977+
},
973978
{
974979
"source_path": "articles/cognitive-services/QnAMaker/Concepts/data-sources-supported.md",
975980
"redirect_url": "/azure/cognitive-services/QnAMaker/concepts/knowledge-base",
@@ -45085,10 +45090,10 @@
4508545090
"redirect_url": "/azure/iot-central/core/howto-use-action-groups/",
4508645091
"redirect_document_id": true
4508745092
},
45088-
{
45089-
"source_path": "articles/storage/blobs/data-lake-storage-use-power-bi.md",
45090-
"redirect_url": "https://docs.microsoft.com/power-query/connectors/datalakestorage",
45091-
"redirect_document_id": false
45093+
{
45094+
"source_path": "articles/storage/blobs/data-lake-storage-use-power-bi.md",
45095+
"redirect_url": "https://docs.microsoft.com/power-query/connectors/datalakestorage",
45096+
"redirect_document_id": false
4509245097
},
4509345098
{
4509445099
"source_path": "articles/iot-central/preview/howto-use-app-templates.md",

articles/cognitive-services/QnAMaker/Quickstarts/add-question-metadata-portal.md

Lines changed: 20 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,48 @@
11
---
22
title: "Quickstart: Add questions and answer in QnA Maker portal"
3-
titleSuffix: Azure Cognitive Services
43
description: This quickstart shows how to add question and answer sets with metadata so your users can find the right answer to their question.
54
services: cognitive-services
65
author: diberry
76
manager: nitinme
87
ms.service: cognitive-services
98
ms.subservice: qna-maker
109
ms.topic: quickstart
11-
ms.date: 11/22/2019
10+
ms.date: 02/08/2020
1211
ms.author: diberry
1312
---
1413

1514
# Quickstart: Add questions and answer with QnA Maker portal
1615

17-
Once a knowledge base is created, add question and answer sets with metadata so your users can find the right answer to their question.
18-
19-
The right answer is a single answer but there can be many ways a customer could ask the question that leads to that single answer.
20-
21-
For example, the questions in the following table are about Azure service limits, but each has to do with a different Azure service.
16+
Once a knowledge base is created, add question and answer (QnA) sets with metadata to filter the answer. The questions in the following table are about Azure service limits, but each has to do with a different Azure service.
2217

2318
<a name="qna-table"></a>
2419

25-
2620
|Set|Questions|Answer|Metadata|
2721
|--|--|--|--|
2822
|#1|`How large a knowledge base can I create?`<br><br>`What is the max size of a knowledge base?`<br><br>`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](https://docs.microsoft.com/azure/cognitive-services/qnamaker/tutorials/choosing-capacity-qnamaker-deployment) for more details.`|`service=qna_maker`<br>`link_in_answer=true`|
2923
|#2|`How many knowledge bases can I have for my QnA Maker service?`<br><br>`I selected a Azure Cognitive Search tier that holds 15 knowledge bases, but I can only create 14 - what is going on?`<br><br>`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`<br>`link_in_answer=false`|
3024

31-
Once metadata is added to a question-and-answer set, the client application can:
25+
Once metadata is added to a QnA set, the client application can:
3226

3327
* Request answers that only match certain metadata.
3428
* Receive all answers but post-process the answers depending on the metadata for each answer.
3529

36-
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
3730

3831
## Prerequisites
3932

40-
* A QnA Maker service
41-
* A Knowledge base created in that QnA Maker service
42-
43-
Both were created in the [first quickstart](../how-to/create-knowledge-base.md).
33+
* Complete the [previous quickstart](./create-publish-knowledge-base.md)
4434

4535
## Sign in to the QnA Maker portal
4636

4737
1. Sign in to the [QnA Maker portal](https://www.qnamaker.ai).
4838

49-
1. Select your existing knowledge base. If you don't have a knowledge base, return to the [previous quickstart](../how-to/create-knowledge-base.md) and finish the steps to create your knowledge base.
39+
1. Select your existing knowledge base from the [previous quickstart](../how-to/create-knowledge-base.md).
5040

5141
## Add additional alternatively-phrased questions
5242

53-
The current knowledge base, from the [previous quickstart](../how-to/create-knowledge-base.md), has the QnA Maker troubleshooting question and answer sets. These sets were created when the URL was added to the knowledge base during the creation process.
54-
55-
When this URL was imported, only one question with one answer was created.
43+
The current knowledge base has the QnA Maker troubleshooting QnA sets. These sets were created when the URL was added to the knowledge base during the creation process.
5644

57-
In this procedure, add additional questions.
45+
When this URL was imported, only one question with one answer was created. In this procedure, add additional questions.
5846

5947
1. From the **Edit** page, use the search textbox above the question and answer sets, to find the question `How large a knowledge base can I create?`
6048

@@ -71,11 +59,13 @@ In this procedure, add additional questions.
7159

7260
`What GB size can a knowledge base be?`
7361

74-
The correct answer is returned in markdown format: `The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](https://docs.microsoft.com/azure/cognitive-services/qnamaker/tutorials/choosing-capacity-qnamaker-deployment) for more details.`
62+
The correct answer is returned in markdown format:
63+
64+
`The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](https://docs.microsoft.com/azure/cognitive-services/qnamaker/tutorials/choosing-capacity-qnamaker-deployment) for more details.`
7565

7666
If you select **Inspect** under the returned answer, you can see more answers met the question but not with the same high level of confidence.
7767

78-
Do not add every possible combination of alternative phrasing. Turn on QnA Maker's [active learning](../how-to/improve-knowledge-base.md), this finds the alternative phrasings that will best help your knowledge base meet your users' needs.
68+
Do not add every possible combination of alternative phrasing. When you turn on QnA Maker's [active learning](../how-to/improve-knowledge-base.md), this finds the alternative phrasings that will best help your knowledge base meet your users' needs.
7969

8070
1. Select **Test** again to close the test window.
8171

@@ -87,11 +77,12 @@ Adding metadata to a question and answer set allows your client application to r
8777

8878
1. Select **View options**, then select **Show metadata**.
8979

90-
1. For the question and answer set you just added, select **Add metadata tags**, then add name of `service` and value of `search`, `service:search`.
80+
1. For the QnA set you just added, select **Add metadata tags**, then add the name of `service` and the value of `search`. It looks like this: `service:search`.
9181

92-
1. Add another metadata tags with name of `link_in_answer` and value of `false`, `link_in_answer:false`.
82+
1. Add another metadata tag with name of `link_in_answer` and value of `false`. It looks like this: `link_in_answer:false`.
9383

9484
1. Search for the first answer in the table, `How large a knowledge base can I create?`.
85+
9586
1. Add metadata pairs for the same two metadata tags:
9687

9788
`link_in_answer` : `true`<br>
@@ -102,71 +93,16 @@ Adding metadata to a question and answer set allows your client application to r
10293
1. Select **Save and train** to retrain the knowledge base.
10394

10495
1. Select **Publish** in the top menu to go to the publish page.
105-
1. Select the **Publish** button to publish the current knowledge base to a queryable endpoint.
106-
1. After the knowledge base is published, select the **Curl** tab to see an example cURL command used to generate an answer from the knowledge base.
107-
1. Copy the command to a note pad or other editable environment so you can edit the command. Edit for your own resource name, knowledge base ID and endpoint key:
96+
1. Select the **Publish** button to publish the current knowledge base to the endpoint.
97+
1. After the knowledge base is published, continue to the next quickstart to learn how to generate an answer from your knowledge base.
10898

109-
|Replace|
110-
|--|
111-
|`your-resource-name`|
112-
|`your-knowledge-base-id`|
113-
|`your-endpoint-key`|
114-
115-
```curl
116-
curl -X POST https://your-resource-name.azurewebsites.net/qnamaker/knowledgebases/your-knowledge-base-id/generateAnswer -H "Authorization: EndpointKey your-endpoint-key" -H "Content-type: application/json" -d "{'top':30, 'question':'size','strictFilters': [{'name':'service','value':'qna_maker'}]}"
117-
```
118-
119-
Notice the question is just a single word, `size`, which can return either question and answer set. The `strictFilters` array tells the response to reduce to just the `qna_maker` answers.
120-
121-
[!INCLUDE [Tip for debug property to JSON request](../includes/tip-debug-json.md)]
122-
123-
1. The response includes only the answer that meets the filter criteria.
124-
125-
The following cURL response has been formatted for readability:
126-
127-
```JSON
128-
{
129-
"answers": [
130-
{
131-
"questions": [
132-
"How large a knowledge base can I create?",
133-
"What is the max size of a knowledge base?",
134-
"How many GB of data can a knowledge base hold?"
135-
],
136-
"answer": "The size of the knowledge base depends on the SKU of Azure search you choose when creating the QnA Maker service. Read [here](https://docs.microsoft.com/azure/cognitive-services/qnamaker/tutorials/choosing-capacity-qnamaker-deployment)for more details.",
137-
"score": 68.76,
138-
"id": 3,
139-
"source": "https://docs.microsoft.com/azure/cognitive-services/qnamaker/troubleshooting",
140-
"metadata": [
141-
{
142-
"name": "link_in_answer",
143-
"value": "true"
144-
},
145-
{
146-
"name": "service",
147-
"value": "qna_maker"
148-
}
149-
],
150-
"context": {
151-
"isContextOnly": false,
152-
"prompts": []
153-
}
154-
}
155-
],
156-
"debugInfo": null
157-
}
158-
```
159-
160-
If there is a question and answer set that didn't meet the search term but did meet the filter, it would not be returned. Instead, the general answer `No good match found in KB.` is returned.
161-
162-
Make sure to keep your metadata name and value pairs within the required limits.
99+
## What did you accomplish?
163100

164-
## Clean up resources
101+
You edited your knowledge base to support more questions and provided name/value pairs to support filtering during the search for the top answer or postprocessing, after the answer or answers are returned.
165102

166-
If you want to clean up and remove a Cognitive Services subscription, you can delete the resource or resource group. Deleting the resource group also deletes any other resources associated with it.
103+
## Clean up resources
167104

168-
* [Portal](../../cognitive-services-apis-create-account.md#clean-up-resources)
169-
* [Azure CLI](../../cognitive-services-apis-create-account-cli.md#clean-up-resources)
105+
If you are not continuing to the next quickstart, delete the QnA Maker and Bot framework resources in the Azure portal.
170106

171107
## Next steps
172108

articles/cognitive-services/QnAMaker/Quickstarts/batch-testing.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: qna-maker
1010
ms.topic: quickstart
11-
ms.date: 12/19/2019
11+
ms.date: 02/08/2020
1212
ms.author: diberry
1313
---
1414

@@ -19,7 +19,7 @@ Use the QnA Maker batch testing tool to test the knowledge bases in your QnA Mak
1919
## Prerequisites
2020

2121
* Azure subscription - [create one for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)
22-
* Either [create a QnA Maker service](create-publish-knowledge-base.md#create-a-new-qna-maker-knowledge-base) or use an existing service, which uses the English language for the sample doc used in this quickstart.
22+
* Either [create a QnA Maker service](create-publish-knowledge-base.md) or use an existing service, which uses the English language.
2323
* Download the [multi-turn sample `.docx` file](https://github.com/Azure-Samples/cognitive-services-sample-data-files/blob/master/qna-maker/data-source-formats/multi-turn.docx)
2424
* Download the [batch testing tool](https://aka.ms/qnamakerbatchtestingtool), extract the executable file from the `.zip` file.
2525

@@ -36,9 +36,16 @@ Use the QnA Maker batch testing tool to test the knowledge bases in your QnA Mak
3636
* Azure QnA Service Name
3737
* Language - the English language
3838
1. Enter the name `Multi-turn batch test quickstart` as the name of your knowledge base.
39-
1. In **Step 4**, check **Enable multi-turn extraction from URLs, .pdf or .docx files**.
40-
1. Enter the **Default answer text** of `Quickstart - can't find answer`. In a production knowledge base, this information should be more instructive to the user but for this quickstart, a simple response works.
41-
1. Still in **Step 4**, select **+ Add file** then select the downloaded `.docx` file listing in the prerequisites.
39+
40+
1. In **Step 4**, configure the settings with the following table:
41+
42+
|Setting|Value|
43+
|--|--|
44+
|**Enable multi-turn extraction from URLs, .pdf or .docx files.**|Checked|
45+
|**Default answer text**| `Batch test - default answer not found.`|
46+
|**+ Add File**|Select the downloaded `.docx` file listing in the prerequisites.|
47+
|**Chit-chat**|Select **Professional**|
48+
4249
1. In **Step 5**, select **Create your KB**.
4350

4451
When the creation process finishes, the portal displays the editable knowledge base.
@@ -155,7 +162,7 @@ There are two main scenarios for batch testing:
155162
* **Process chat log files** - Determine the top answer for a previously unseen question - the most common situation is when you need to process are log file of queries, such as a chat bot's user questions. Create a batch file test, with only the required columns. The test returns the top answer for each question. That doesn't mean it the top answer is the correct answer. Once you complete this test, move on to the validation test.
156163
* **Validation test** - Validate the expected answer. This test requires that all the questions and matching expected answers in the batch test have been validated. This may require some manual process.
157164

158-
The following procedure assumes the scenario is to process chat logs with
165+
The following procedure assumes the scenario is to process chat logs with
159166

160167
1. Create a new batch test file to include optional data, `batch-test-data-2.tsv`. Add the 6 rows from the original batch test input file, then add the metadata, top, and QnA set ID for each row.
161168

0 commit comments

Comments
 (0)