Skip to content

Commit 9d8217e

Browse files
committed
Updating REST Node.js. Now consistent with Python. Leverages the changes to get-key.
1 parent a8dd204 commit 9d8217e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

articles/cognitive-services/LUIS/includes/get-started-get-intent-rest-nodejs.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ms.author: diberry
2222

2323
## Get intent programmatically
2424

25-
Use Node.js to query the prediction endpoint GET [API](https://aka.ms/luis-apim-v3-prediction) to get the prediction result.
25+
Use Node.js to query the [prediction endpoint](https://aka.ms/luis-apim-v3-prediction) and get a prediction result.
2626

2727
1. Copy the following code snippet to a file named `predict.js`:
2828

@@ -71,24 +71,24 @@ Use Node.js to query the prediction endpoint GET [API](https://aka.ms/luis-apim-
7171
getPrediction().then(()=>console.log("done")).catch((err)=>console.log(err));
7272
```
7373

74-
1. Set the following values:
74+
1. Replace the following values:
7575

76-
* `YOUR-KEY` to your starter key
77-
* `YOUR-ENDPOINT` to your endpoint URL
76+
* `YOUR-KEY` to your starter key.
77+
* `YOUR-ENDPOINT` to your endpoint URL. For example, `westus2.api.cognitive.microsoft.com`.
7878

79-
1. Install dependencies by running the following command at the command-line:
79+
1. Install the `request`, `request-promise`, and `querystring` dependencies with this command:
8080

8181
```console
8282
npm install request request-promise querystring
8383
```
8484

85-
1. Run the code with the following command:
85+
1. Run your app with this command:
8686

8787
```console
8888
node predict.js
8989
```
9090

91-
1. Review prediction response in JSON format:
91+
1. Review the prediction response, which is returned as JSON:
9292

9393
```console
9494
{"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"]}]}}}}

articles/cognitive-services/LUIS/includes/get-started-get-intent-rest-python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Use Python to query the [prediction endpoint](https://aka.ms/luis-apim-v3-predic
5959

6060
1. Replace the following values:
6161

62-
* `YOUR-KEY` with your starter key
63-
* `YOUR-ENDPOINT` with your endpoint. For example, `westus2.api.cognitive.microsoft.com`
62+
* `YOUR-KEY` with your starter key.
63+
* `YOUR-ENDPOINT` with your endpoint. For example, `westus2.api.cognitive.microsoft.com`.
6464

6565
1. Install the `requests` dependency. This is used to make HTTP requests:
6666

0 commit comments

Comments
 (0)