Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 2.69 KB

luis-get-started-java-get-intent.md

File metadata and controls

67 lines (42 loc) · 2.69 KB
title titleSuffix description author manager ms.custom ms.service ms.component ms.topic ms.date ms.author
Quickstart: get intent - Java
Language Understanding - Azure Cognitive Services
In this quickstart, use an available public LUIS app to determine a user's intention from conversational text. Using Java, 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.
diberry
cgronlun
seodec18
cognitive-services
language-understanding
quickstart
09/10/2018
diberry

Quickstart: Get intent using Java

In this quickstart, pass utterances to a LUIS endpoint and get intent and entities back.

[!INCLUDE Quickstart introduction for endpoint]

Prerequisites

  • JDK SE (Java Development Kit, Standard Edition)
  • Visual Studio Code
  • Public app ID: df67dcdb-c37d-46af-88e1-8b97951ca1c2

[!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

You can use Java to access the same results you saw in the browser window in the previous step.

  1. Copy the following code to create a class in a file named LuisGetRequest.java:

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

  2. Replace the value of the YOUR-KEY variable with your LUIS key.

  3. Compile the java program with javac -cp ":lib/*" LuisGetRequest.java.

  4. Run the application with java -cp ":lib/*" LuisGetRequest.java. 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

Delete the Java file.

Next steps

[!div class="nextstepaction"] Add utterances