@@ -6,7 +6,7 @@ author: diberry
6
6
manager : nitinme
7
7
ms.service : cognitive-services
8
8
ms.topic : include
9
- ms.date : 10/17 /2019
9
+ ms.date : 11/20 /2019
10
10
ms.author : diberry
11
11
---
12
12
## Prerequisites
@@ -21,7 +21,7 @@ ms.author: diberry
21
21
22
22
## Get intent programmatically
23
23
24
- Use Java to query the prediction endpoint GET [ API ] ( https://aka.ms/luis-apim-v3-prediction ) to get the prediction result.
24
+ Use Java to query the [ prediction endpoint] ( https://aka.ms/luis-apim-v3-prediction ) and get a prediction result.
25
25
26
26
1 . Make a subdirectory named ` lib ` and copy in the following java libs:
27
27
@@ -31,7 +31,6 @@ Use Java to query the prediction endpoint GET [API](https://aka.ms/luis-apim-v3-
31
31
32
32
1 . Copy the following code to create a class in a file named ` Predict.java ` :
33
33
34
-
35
34
``` java
36
35
import java.io.* ;
37
36
import java.net.URI ;
@@ -102,10 +101,10 @@ Use Java to query the prediction endpoint GET [API](https://aka.ms/luis-apim-v3-
102
101
1. Replace the following values:
103
102
104
103
* `YOUR - KEY ` with your starter key
105
- * `YOUR - ENDPOINT ` with your endpoint, for example, `westus2. api. cognitive. microsoft. com`
104
+ * `YOUR - ENDPOINT ` with your endpoint. For example, `westus2. api. cognitive. microsoft. com`.
106
105
107
106
108
- 1. Compile the java program from a command line:
107
+ 1. Compile the java program from the command line:
109
108
110
109
```console
111
110
javac - cp " :lib/*" Predict . java
@@ -117,7 +116,7 @@ Use Java to query the prediction endpoint GET [API](https://aka.ms/luis-apim-v3-
117
116
java - cp " :lib/*" Predict
118
117
```
119
118
120
- 1. Review prediction response in JSON format :
119
+ 1. Review the prediction response, which is returned as JSON :
121
120
122
121
```console
123
122
{' query' : ' turn on all lights' , ' prediction' : {' topIntent' : ' HomeAutomation.TurnOn' , ' intents' : {' HomeAutomation.TurnOn' : {' score' : 0.5375382 }, ' None' : {' score' : 0.08687421 }, ' HomeAutomation.TurnOff' : {' score' : 0.0207554 }}, ' entities' : {' HomeAutomation.Operation' : [' on' ], ' $instance' : {' HomeAutomation.Operation' : [{' type' : ' HomeAutomation.Operation' , ' text' : ' on' , ' startIndex' : 5 , ' length' : 2 , ' score' : 0.724984169 , ' modelTypeId' : - 1 , ' modelType' : ' Unknown' , ' recognitionSources' : [' model' ]}]}}}}
0 commit comments