You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cognitive-services/LUIS/includes/sdk-csharp-authoring.md
+14-62Lines changed: 14 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: diberry
6
6
manager: nitinme
7
7
ms.service: cognitive-services
8
8
ms.subservice: language-understanding
9
-
ms.date: 02/14/2020
9
+
ms.date: 05/26/2020
10
10
ms.topic: include
11
11
ms.custom: include file
12
12
ms.author: diberry
@@ -23,55 +23,13 @@ Use the Language Understanding (LUIS) authoring client library for .NET to:
23
23
24
24
## Prerequisites
25
25
26
-
*Language Understanding (LUIS) portal account - [Create one for free](https://www.luis.ai)
26
+
*Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
27
27
* The current version of [.NET Core](https://dotnet.microsoft.com/download/dotnet-core).
28
-
28
+
* Once you have your Azure subscription, [create a Language Understanding authoring resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesLUISAllInOne) in the Azure portal to get your key and endpoint. Wait for it to deploy and click the **Go to resource** button.
29
+
* You will need the key and endpoint from the resource you [create](../luis-how-to-azure-subscription.md#create-luis-resources-in-azure-portal) to connect your application to Language Understanding authoring. You'll paste your key and endpoint into the code below later in the quickstart. You can use the free pricing tier (`F0`) to try the service.
29
30
30
31
## Setting up
31
32
32
-
### Get your Language Understanding (LUIS) starter key
33
-
34
-
Get your [starter key](../luis-how-to-azure-subscription.md#starter-key) by creating a LUIS authoring resource. Keep your key, and the region of the key for the next step.
35
-
36
-
### Create an environment variable
37
-
38
-
Using your key, and the region for the key, create two environment variables for authentication:
39
-
40
-
*`COGNITIVESERVICE_AUTHORING_KEY` - The resource key for authenticating your requests.
41
-
*`COGNITIVESERVICE_REGION` - The region associated with your key. For example `westus`.
After you add the environment variable, run `source .bash_profile` from your console window to make the changes effective.
73
-
***
74
-
75
33
### Create a new C# application
76
34
77
35
Create a new .NET Core application in your preferred editor or IDE.
@@ -142,23 +100,17 @@ These code snippets show you how to do the following with the Language Understan
142
100
143
101
From the project directory, open the *Program.cs* file in your preferred editor or IDE. Replace the existing `using` code with the following `using` directives:
1. Create a variable to manage your authoring key pulled from an environment variable named `COGNITIVESERVICES_AUTHORING_KEY`. If you created the environment variable after the application is launched, the editor, IDE, or shell running it will need to be closed and reloaded to access the variable. The methods will be created later.
150
-
151
-
1. Create variables to hold your authoring region and endpoint. The region of your authoring key depends on where you are authoring. The [three authoring regions](../luis-reference-regions.md) are:
152
-
153
-
* Australia - `australiaeast`
154
-
* Europe - `westeurope`
155
-
* U.S. and other regions - `westus` (Default)
107
+
1. Create a variable to hold your authoring key and authoring endpoint.
156
108
157
-
[!code-csharp[Authorization to resource key](~/cognitive-services-dotnet-sdk-samples/documentation-samples/quickstarts/LUIS/LUIS.cs?name=Variables)]
109
+
[!code-csharp[Authorization to resource key](~/cognitive-services-quickstart-code/dotnet/LanguageUnderstanding/authoring/authoring-with-sdk.cs?name=Variables)]
158
110
159
111
1. Create an [ApiKeyServiceClientCredentials](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.apikeyserviceclientcredentials?view=azure-dotnet) object with your key, and use it with your endpoint to create an [LUISAuthoringClient](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.luisauthoringclient?view=azure-dotnet) object.
160
112
161
-
[!code-csharp[Create LUIS client object](~/cognitive-services-dotnet-sdk-samples/documentation-samples/quickstarts/LUIS/LUIS.cs?name=AuthoringCreateClient)]
113
+
[!code-csharp[Create LUIS client object](~/cognitive-services-quickstart-code/dotnet/LanguageUnderstanding/authoring/authoring-with-sdk.cs?name=AuthoringCreateClient)]
162
114
163
115
## Create a LUIS app
164
116
@@ -168,14 +120,14 @@ From the project directory, open the *Program.cs* file in your preferred editor
168
120
169
121
1. Call the [Apps.AddAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.appsextensions.addasync?view=azure-dotnet) method. The response is the app ID.
170
122
171
-
[!code-csharp[Create a LUIS app](~/cognitive-services-dotnet-sdk-samples/documentation-samples/quickstarts/LUIS/LUIS.cs?name=AuthoringCreateApplication)]
123
+
[!code-csharp[Create a LUIS app](~/cognitive-services-quickstart-code/dotnet/LanguageUnderstanding/authoring/authoring-with-sdk.cs?name=AuthoringCreateApplication)]
172
124
173
125
## Create intent for the app
174
126
The primary object in a LUIS app's model is the intent. The intent aligns's with a grouping of user utterance _intentions_. A user may ask a question, or make a statement looking for a particular _intended_ response from a bot (or other client application). Examples of intentions are booking a flight, asking about weather in a destination city, and asking about contact information for customer service.
175
127
176
128
Create a [ModelCreateObject](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.models.modelcreateobject?view=azure-dotnet) with the name of the unique intent then pass the app ID, version ID, and the ModelCreateObject to the [Model.AddIntentAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.modelextensions.addintentasync?view=azure-dotnet) method. The response is the intent ID.
@@ -187,7 +139,7 @@ It is important to know that entities are not marked with an intent. They can an
187
139
188
140
Creation methods for entities are part of the [Model](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.modelextensions?view=azure-dotnet) class. Each entity type has its own data transformation object (DTO) model, usually containing the word `model` in the [Models](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.models?view=azure-dotnet) namespace.
@@ -197,7 +149,7 @@ Add example utterances by creating a list of [ExampleLabelObject](https://docs.m
197
149
198
150
Call [Examples.BatchAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.examplesextensions.batchasync?view=azure-dotnet#Microsoft_Azure_CognitiveServices_Language_LUIS_Authoring_ExamplesExtensions_BatchAsync_Microsoft_Azure_CognitiveServices_Language_LUIS_Authoring_IExamples_System_Guid_System_String_System_Collections_Generic_IList_Microsoft_Azure_CognitiveServices_Language_LUIS_Authoring_Models_ExampleLabelObject__System_Threading_CancellationToken_) with the app ID, version ID, and the list of examples. The call responds with a list of results. You need to check each example's result to make sure it was successfully added to the model.
199
151
200
-
[!code-csharp[Add example utterances to a specific intent](~/cognitive-services-dotnet-sdk-samples/documentation-samples/quickstarts/LUIS/LUIS.cs?name=AuthoringBatchAddUtterancesForIntent)]
152
+
[!code-csharp[Add example utterances to a specific intent](~/cognitive-services-quickstart-code/dotnet/LanguageUnderstanding/authoring/authoring-with-sdk.cs?name=AuthoringBatchAddUtterancesForIntent)]
201
153
202
154
The **CreateUtterance** and **CreateLabel** methods are utility methods to help you create objects.
203
155
@@ -209,13 +161,13 @@ The [Train.TrainVersionAsync](https://docs.microsoft.com/dotnet/api/microsoft.az
209
161
210
162
A very small model, such as this quickstart shows, will train very quickly. For production-level applications, training the app should include a polling call to the [GetStatusAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.trainextensions.getstatusasync?view=azure-dotnet#Microsoft_Azure_CognitiveServices_Language_LUIS_Authoring_TrainExtensions_GetStatusAsync_Microsoft_Azure_CognitiveServices_Language_LUIS_Authoring_ITrain_System_Guid_System_String_System_Threading_CancellationToken_) method to determine when or if the training succeeded. The response is a list of [ModelTrainingInfo](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.models.modeltraininginfo?view=azure-dotnet) objects with a separate status for each object. All objects must be successful for the training to be considered complete.
211
163
212
-
[!code-csharp[Train the app's version](~/cognitive-services-dotnet-sdk-samples/documentation-samples/quickstarts/LUIS/LUIS.cs?name=AuthoringTrainVersion)]
164
+
[!code-csharp[Train the app's version](~/cognitive-services-quickstart-code/dotnet/LanguageUnderstanding/authoring/authoring-with-sdk.cs?name=AuthoringTrainVersion)]
213
165
214
166
## Publish a Language Understanding app
215
167
216
168
Publish the LUIS app using the [PublishAsync](https://docs.microsoft.com/dotnet/api/microsoft.azure.cognitiveservices.language.luis.authoring.appsextensions.publishasync?view=azure-dotnet) method. This publishes the current trained version to the specified slot at the endpoint. Your client application uses this endpoint to send user utterances for prediction of intent and entity extraction.
Copy file name to clipboardExpand all lines: articles/cognitive-services/LUIS/includes/sdk-python-authoring.md
+5-46Lines changed: 5 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: diberry
6
6
manager: nitinme
7
7
ms.service: cognitive-services
8
8
ms.subservice: language-understanding
9
-
ms.date: 02/14/2020
9
+
ms.date: 05/26/2020
10
10
ms.topic: include
11
11
ms.custom: include file
12
12
ms.author: diberry
@@ -22,54 +22,13 @@ Use the Language Understanding (LUIS) authoring client library for Python to:
22
22
23
23
## Prerequisites
24
24
25
-
* Language Understanding (LUIS) portal account: [Create one for free](https://www.luis.ai).
26
-
*[Python 3.x](https://www.python.org/)
25
+
* Azure subscription - [Create one for free](https://azure.microsoft.com/free/)
26
+
* The current version of [Python 3.x](https://www.python.org/).
27
+
* Once you have your Azure subscription, [create a Language Understanding authoring resource](https://ms.portal.azure.com/#create/Microsoft.CognitiveServicesLUISAllInOne) in the Azure portal to get your key and endpoint. Wait for it to deploy and click the **Go to resource** button.
28
+
* You will need the key and endpoint from the resource you [create](../luis-how-to-azure-subscription.md#create-luis-resources-in-azure-portal) to connect your application to Language Understanding authoring. You'll paste your key and endpoint into the code below later in the quickstart. You can use the free pricing tier (`F0`) to try the service.
27
29
28
30
## Setting up
29
31
30
-
### Get your Language Understanding (LUIS) starter key
31
-
32
-
Get your [starter key](../luis-how-to-azure-subscription.md#starter-key) by creating a LUIS authoring resource. Keep your key, and the region of the key for the next step.
33
-
34
-
### Create an environment variable
35
-
36
-
Using your key, and the region for the key, create two environment variables for authentication:
37
-
38
-
*`LUIS_AUTHORING_KEY` - The resource key for authenticating your requests.
39
-
*`LUIS_REGION` - The region associated with your key. For example `westus`.
Copy file name to clipboardExpand all lines: articles/cognitive-services/LUIS/sdk-authoring.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: "Quickstart: Language Understanding (LUIS) authoring client library"
3
3
description: Get started with the LUIS client library with this quickstart. Follow these steps to install the package and try out the example code for basic tasks.
0 commit comments