Skip to content

Commit f62f9ed

Browse files
authored
Merge pull request #110861 from Ja-Dunn/two-qnamaker-tutorials
edit pass: two-qnamaker-tutorials
2 parents 2c25b4d + 8b36a39 commit f62f9ed

File tree

2 files changed

+160
-154
lines changed

2 files changed

+160
-154
lines changed

articles/cognitive-services/QnAMaker/Tutorials/integrate-qnamaker-luis.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
title: LUIS and QnAMaker - Bot Integration
2+
title: LUIS and QnAMaker - bot integration
33
titleSuffix: Azure Cognitive Services
4-
description: As your QnA Maker knowledge base grows large, it becomes difficult to maintain it as a single monolithic set and there is a need to split the knowledge base into smaller logical chunks.
4+
description: As your QnA Maker knowledge base grows larger, it becomes difficult to maintain it as a single monolithic set. Split the knowledge base into smaller, logical chunks.
55
services: cognitive-services
66
author: diberry
77
manager: nitinme
@@ -13,50 +13,50 @@ ms.author: diberry
1313
ms.custom: seodec18
1414
---
1515

16-
# Use bot with QnA Maker and LUIS to distribute your knowledge base
17-
As your QnA Maker knowledge base grows large, it becomes difficult to maintain it as a single monolithic set and there is a need to split the knowledge base into smaller logical chunks.
16+
# Use a bot with QnA Maker and LUIS to distribute your knowledge base
17+
As your QnA Maker knowledge base grows larger, it becomes difficult to maintain it as a single monolithic set. Split the knowledge base into smaller, logical chunks.
1818

19-
While it is straightforward to create multiple knowledge bases in QnA Maker, you will need some logic to route the incoming question to the appropriate knowledge base. You can do this by using LUIS.
19+
Although it's straightforward to create multiple knowledge bases in QnA Maker, you will need some logic to route the incoming question to the appropriate knowledge base. You can do this by using LUIS.
2020

21-
This article uses Bot Framework v3 SDK. Please see this [Bot Framework article](https://docs.microsoft.com/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=csharp), if you are interested in Bot Framework v4 SDK version of this information.
21+
This article uses the Bot Framework v3 SDK. If you're interested in the Bot Framework v4 SDK version of this information, see [Use multiple LUIS and QnA models](https://docs.microsoft.com/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=csharp).
2222

2323
## Architecture
2424

25-
![QnA Maker with Language Understanding architecture](../media/qnamaker-tutorials-qna-luis/qnamaker-luis-architecture.PNG)
25+
![Graphic showing architecture of QnA Maker with Language Understanding](../media/qnamaker-tutorials-qna-luis/qnamaker-luis-architecture.PNG)
2626

27-
In the above scenario, QnA Maker first gets the intent of the incoming question from a LUIS model, and then use that to route it to the correct QnA Maker knowledge base.
27+
The preceding graphic shows that QnA Maker first gets the intent of the incoming question from a LUIS model. Then, QnA Maker uses that intent to route the question to the correct QnA Maker knowledge base.
2828

2929
## Create a LUIS app
3030

3131
1. Sign in to the [LUIS](https://www.luis.ai/) portal.
3232
1. [Create an app](https://docs.microsoft.com/azure/cognitive-services/luis/create-new-app).
3333
1. [Add an intent](https://docs.microsoft.com/azure/cognitive-services/luis/add-intents) for each QnA Maker knowledge base. The example utterances should correspond to questions in the QnA Maker knowledge bases.
34-
1. [Train the LUIS app](https://docs.microsoft.com/azure/cognitive-services/luis/luis-how-to-train) and [publish the LUIS app](https://docs.microsoft.com/azure/cognitive-services/luis/publishapp) your LUIS App.
34+
1. [Train the LUIS app](https://docs.microsoft.com/azure/cognitive-services/luis/luis-how-to-train) and [publish the LUIS app](https://docs.microsoft.com/azure/cognitive-services/luis/publishapp).
3535
1. In the **Manage** section, make note of your LUIS app ID, LUIS endpoint key, and [custom domain name](../../cognitive-services-custom-subdomains.md). You will need these values later.
3636

3737
## Create QnA Maker knowledge bases
3838

3939
1. Sign in to [QnA Maker](https://qnamaker.ai).
40-
1. [Create](https://www.qnamaker.ai/Create) a knowledge bases for each intent in the LUIS app.
41-
1. Test and publish the knowledge bases. When you publish each KB, make note of the KB ID, resource name (custom subdomain before _.azurewebsites.net/qnamaker_), and the authorization endpoint key. You will need these values later.
40+
1. [Create](https://www.qnamaker.ai/Create) a knowledge base for each intent in the LUIS app.
41+
1. Test and publish the knowledge bases. When you publish each one, make note of the ID, resource name (the custom subdomain before _.azurewebsites.net/qnamaker_), and the authorization endpoint key. You will need these values later.
4242

43-
This article assumes the KBs are all created in the same Azure QnA Maker subscription.
43+
This article assumes the knowledge bases are all created in the same Azure QnA Maker subscription.
4444

45-
![QnA Maker HTTP request](../media/qnamaker-tutorials-qna-luis/qnamaker-http-request.png)
45+
![Screenshot of QnA Maker HTTP request](../media/qnamaker-tutorials-qna-luis/qnamaker-http-request.png)
4646

47-
## Web app Bot
47+
## Web app bot
4848

49-
1. [Create a "Basic" Web App bot](https://docs.microsoft.com/azure/bot-service/bot-service-quickstart?view=azure-bot-service-4.0) which automatically includes a LUIS app. Select C# programming language.
49+
1. [Create a "Basic" bot with Azure Bot Service](https://docs.microsoft.com/azure/bot-service/bot-service-quickstart?view=azure-bot-service-4.0), which automatically includes a LUIS app. Select the C# programming language.
5050

51-
1. Once the web app bot is created, in the Azure portal, select the web app bot.
52-
1. Select **Application Settings** in the Web app bot service navigation, then scroll down to **Application settings** section of available settings.
53-
1. Change the **LuisAppId** to the value of the LUIS app created in the preceding section then select **Save**.
51+
1. After you create the web app bot, in the Azure portal, select the web app bot.
52+
1. In the web app bot service navigation, select **Application Settings**. Then scroll down to the **Application settings** section of available settings.
53+
1. Change the **LuisAppId** to the value of the LUIS app created in the preceding section. Then select **Save**.
5454

5555

56-
## Change code in BasicLuisDialog.cs
56+
## Change the code in the BasicLuisDialog.cs file
5757
1. From the **Bot Management** section of the web app bot navigation in the Azure portal, select **Build**.
5858
2. Select **Open online code editor**. A new browser tab opens with the online editing environment.
59-
3. In the **WWWROOT** section, select the **Dialogs** directory, then open **BasicLuisDialog.cs**.
59+
3. In the **WWWROOT** section, select the **Dialogs** directory, and then open **BasicLuisDialog.cs**.
6060
4. Add dependencies to the top of the **BasicLuisDialog.cs** file:
6161

6262
```csharp
@@ -71,7 +71,7 @@ In the above scenario, QnA Maker first gets the intent of the incoming question
7171
using System.Text;
7272
```
7373

74-
5. Add the below classes to deserialize the QnA Maker response:
74+
5. Add the following classes to deserialize the QnA Maker response:
7575

7676
```csharp
7777
public class Metadata
@@ -98,7 +98,7 @@ In the above scenario, QnA Maker first gets the intent of the incoming question
9898
```
9999

100100

101-
6. Add the following class to make an HTTP request to the QnA Maker service. Notice that the **Authorization** header's value includes the word, `EndpointKey` with a space following the word. The JSON result is deserialized into the preceding classes and the first answer is returned.
101+
6. Add the following class to make an HTTP request to the QnA Maker service. Notice that the **Authorization** header's value includes the word, `EndpointKey`, with a space following the word. The JSON result is deserialized into the preceding classes, and the first answer is returned.
102102

103103
```csharp
104104
[Serializable]
@@ -150,7 +150,7 @@ In the above scenario, QnA Maker first gets the intent of the incoming question
150150
```
151151

152152

153-
7. Modify the BasicLuisDialog class. Each LUIS intent should have a method decorated with **LuisIntent**. The parameter to the decoration is the actual LUIS intent name. The method name that is decorated _should_ be the LUIS intent name for readability and maintainability but doesn't have to be the same at design or run time.
153+
7. Modify the `BasicLuisDialog` class. Each LUIS intent should have a method decorated with **LuisIntent**. The parameter to the decoration is the actual LUIS intent name. The method name that is decorated _should_ be the LUIS intent name for readability and maintainability, but doesn't have to be the same at design or runtime.
154154

155155
```csharp
156156
[Serializable]
@@ -162,7 +162,7 @@ In the above scenario, QnA Maker first gets the intent of the incoming question
162162
static string LUIS_hostRegion = "westus.api.cognitive.microsoft.com";
163163

164164
// QnA Maker global settings
165-
// assumes all KBs are created with same Azure service
165+
// assumes all knowledge bases are created with same Azure service
166166
static string qnamaker_endpointKey = "<QnA Maker endpoint KEY>";
167167
static string qnamaker_resourceName = "my-qnamaker-s0-s";
168168

@@ -219,20 +219,20 @@ In the above scenario, QnA Maker first gets the intent of the incoming question
219219

220220

221221
## Build the bot
222-
1. In the code editor, right-click on `build.cmd` and select **Run from Console**.
222+
1. In the code editor, right-click **build.cmd**, and select **Run from Console**.
223223

224-
![run from console](../media/qnamaker-tutorials-qna-luis/run-from-console.png)
224+
![Screenshot of Run from Console option in the code editor](../media/qnamaker-tutorials-qna-luis/run-from-console.png)
225225

226-
2. The code view is replaced with a terminal window showing the progress and results of the build.
226+
2. The code view is replaced with a terminal window that shows the progress and results of the build.
227227

228-
![console build](../media/qnamaker-tutorials-qna-luis/console-build.png)
228+
![Screenshot of the console build](../media/qnamaker-tutorials-qna-luis/console-build.png)
229229

230230
## Test the bot
231231
In the Azure portal, select **Test in Web Chat** to test the bot. Type messages from different intents to get the response from the corresponding knowledge base.
232232

233-
![web chat test](../media/qnamaker-tutorials-qna-luis/qnamaker-web-chat.png)
233+
![Screenshot of web chat test](../media/qnamaker-tutorials-qna-luis/qnamaker-web-chat.png)
234234

235235
## Next steps
236236

237237
> [!div class="nextstepaction"]
238-
> [Integrate your knowledge base with a Power Virtual Agent](integrate-with-power-virtual-assistant-fallback-topic.md)
238+
> [Integrate your knowledge base with an agent in Power Virtual Agents](integrate-with-power-virtual-assistant-fallback-topic.md)

0 commit comments

Comments
 (0)