Permalink
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (44 sloc) 3.2 KB
title titleSuffix description services author manager ms.service ms.component ms.topic ms.date ms.author
C# Quickstart - predict intent - LUIS
Azure Cognitive Services
In this quickstart, use an available public LUIS app to determine a user's intention from conversational text. Using C#, send the user's intention as text to the public app's HTTP prediction endpoint. At the endpoint, LUIS applies the public app's model to analyze the natural language text for meaning, determining overall intent and extracting data relevant to the app's subject domain.
cognitive-services
diberry
cgronlun
cognitive-services
language-understanding
quickstart
09/10/2018
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.

    LUIS user settings menu access

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

    LUIS user settings menu access

  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#