Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (45 sloc) 3.01 KB
title titleSuffix description services author manager ms.custom ms.service ms.subservice ms.topic ms.date ms.author
Get intent, C#
Language Understanding - Azure Cognitive Services
In this C# quickstart, use an available public LUIS app to determine a user's intention from conversational text.
cognitive-services
diberry
nitinme
seodec18
cognitive-services
language-understanding
quickstart
07/16/2019
diberry

Quickstart: Get intent using C#

[!INCLUDE Quickstart introduction for endpoint]

Prerequisites

[!INCLUDE Use authoring key for endpoint]

Get LUIS key

[!INCLUDE Use authoring key for endpoint]

Get intent with browser

[!INCLUDE Use authoring key for endpoint]

Get intent programmatically

Use C# to query the prediction endpoint GET API to get the same results as you saw in the browser window in the previous section.

  1. Create a new console application in Visual Studio.

    Create a new console application in Visual Studio

  2. In the Visual Studio project, in the Solutions Explorer, select Add reference, then select System.Web from the Assemblies tab.

    select Add reference, then select System.Web from the Assemblies tab

  3. Overwrite Program.cs with the following code:

    [!code-csharpConsole app code that calls a LUIS endpoint]

  4. Replace the value of YOUR_KEY with your LUIS key.

  5. Build and run the console application. It displays the same JSON that you saw earlier in the browser window.

    Console window displays JSON result from LUIS

LUIS keys

[!INCLUDE Use authoring key for endpoint]

Clean up resources

When you are finished with this quickstart, close the Visual Studio project and remove the project directory from the file system.

Next steps

[!div class="nextstepaction"] Add utterances and train with C#

You can’t perform that action at this time.