Skip to content

Commit f94955d

Browse files
authored
Merge pull request #103958 from diberry/diberry/0211-luis-spelling
[Cogsvcs] LUIS - spell check
2 parents a6a628f + 9ff75b1 commit f94955d

File tree

4 files changed

+73
-117
lines changed

4 files changed

+73
-117
lines changed

articles/cognitive-services/LUIS/developer-reference-resource.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: Developer resources - Language Understanding
33
description: SDKs, REST APIs, CLI, help you develop Language Understanding (LUIS) apps in your programming language. Manage your Azure resources and LUIS predictions.
44
ms.topic: reference
5-
ms.date: 02/09/2020
5+
ms.date: 02/11/2020
66
---
77

88
# SDK, REST, and CLI developer resources for Language Understanding (LUIS)
99

10-
SDKs, REST APIs, CLI, help you develop Language Understanding (LUIS) apps in your programming language. Manage your Azure resources and LUIS predictions.
10+
SDKs, REST APIs, CLI, help you develop Language Understanding (LUIS) apps in your programming language. Manage your Azure resources and LUIS predictions.
1111

1212
## Azure resource management
1313

@@ -31,6 +31,10 @@ Learn about the [V3 prediction endpoint](luis-migration-api-v3.md).
3131

3232
Use [Cognitive Services sample code](https://github.com/Azure-Samples/cognitive-services-quickstart-code) to learn and use the most common tasks.
3333

34+
### REST specifications
35+
36+
The [LUIS REST specifications](https://github.com/Azure/azure-rest-api-specs/tree/master/specification/cognitiveservices/data-plane/LUIS), along with all [Azure REST specifications](https://github.com/Azure/azure-rest-api-specs), are publicly available on GitHub.
37+
3438
### REST APIs
3539

3640
Both authoring and prediction endpoint APIS are available from REST APIs:
@@ -40,6 +44,29 @@ Both authoring and prediction endpoint APIS are available from REST APIs:
4044
|Authoring|[V2](https://go.microsoft.com/fwlink/?linkid=2092087)<br>[preview V3](https://westeurope.dev.cognitive.microsoft.com/docs/services/luis-programmatic-apis-v3-0-preview)|
4145
|Prediction|[V2](https://go.microsoft.com/fwlink/?linkid=2092356)<br>[V3](https://westcentralus.dev.cognitive.microsoft.com/docs/services/luis-endpoint-api-v3-0/)|
4246

47+
### REST Endpoints
48+
49+
LUIS currently has 2 types of endpoints:
50+
51+
* authoring on the training endpoint
52+
* query prediction on the runtime endpoint.
53+
54+
|Purpose|URL|
55+
|--|--|
56+
|Authoring on training endpoint|`https://{your-resource-name}.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appID}/`|
57+
|V2 Runtime - all predictions on runtime endpoint|`https://{your-resource-name}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q={q}[&timezoneOffset][&verbose][&spellCheck][&staging][&bing-spell-check-subscription-key][&log]`|
58+
|V3 Runtime - versions prediction on runtime endpoint|`https://{your-resource-name}.api.cognitive.microsoft.com/luis/prediction/v3.0/apps/{appId}/versions/{versionId}/predict?query={query}[&verbose][&log][&show-all-intents]`|
59+
|V3 Runtime - slot prediction on runtime endpoint|`https://{your-resource-name}.api.cognitive.microsoft.com/luis/prediction/v3.0/apps/{appId}/slots/{slotName}/predict?query={query}[&verbose][&log][&show-all-intents]`|
60+
61+
The following table explains the parameters, denoted with curly braces `{}`, in the previous table.
62+
63+
|Parameter|Purpose|
64+
|--|--|
65+
|`your-resource-name`|Azure resource name|
66+
|`q` or `query`|utterance text sent from client application such as chat bot|
67+
|`version`|10 character version name|
68+
|`slot`| `production` or `staging`|
69+
4370
### Language-based SDKs
4471

4572
|Language |Reference documentation|Package|Samples|Quickstarts|
@@ -72,7 +99,7 @@ Bot framework provides [several tools](https://github.com/microsoft/botbuilder-t
7299
* [Dispatch](https://github.com/microsoft/botbuilder-tools/blob/master/packages/Dispatch)- manage parent and child apps
73100
* [LUISGen](https://github.com/microsoft/botbuilder-tools/blob/master/packages/LUISGen) - Auto generate backing C#/Typescript classes for your LUIS intents and entities.
74101
* [Bot Framework emulator](https://github.com/Microsoft/BotFramework-Emulator/releases) - a desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK
75-
102+
* [Bot Framework Composer](https://github.com/microsoft/BotFramework-Composer/blob/stable/README.md) - an integrated development tool for developers and multi-disciplinary teams to build bots and conversational experiences with the Microsoft Bot Framework
76103

77104
## Next steps
78105

articles/cognitive-services/LUIS/luis-concept-data-alteration.md

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,25 @@
11
---
22
title: Data alteration - LUIS
3-
titleSuffix: Azure Cognitive Services
43
description: Learn how data can be changed before predictions in Language Understanding (LUIS)
5-
services: cognitive-services
6-
author: diberry
7-
manager: nitinme
8-
ms.custom: seodec18
9-
ms.service: cognitive-services
10-
ms.subservice: language-understanding
114
ms.topic: conceptual
12-
ms.date: 11/19/2019
13-
ms.author: diberry
5+
ms.date: 02/11/2020
146
---
157

168
# Alter utterance data before or during prediction
17-
LUIS provides ways to manipulate the utterance before or during the prediction. These include [fixing spelling](luis-tutorial-bing-spellcheck.md), and fixing timezone issues for prebuilt [datetimeV2](luis-reference-prebuilt-datetimev2.md).
9+
LUIS provides ways to manipulate the utterance before or during the prediction. These include [fixing spelling](luis-tutorial-bing-spellcheck.md), and fixing timezone issues for prebuilt [datetimeV2](luis-reference-prebuilt-datetimev2.md).
1810

1911
## Correct spelling errors in utterance
2012

21-
[!INCLUDE [Not supported in V3 API prediction endpoint](./includes/v2-support-only.md)]
2213

14+
### V3 runtime
2315

24-
LUIS uses [Bing Spell Check API V7](../Bing-Spell-Check/overview.md) to correct spelling errors in the utterance. LUIS needs the key associated with that service. Create the key, then add the key as a querystring parameter at the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356).
16+
Preprocess text for spelling corrections before you send the utterance to LUIS. Use example utterances with the correct spelling to ensure you get the correct predictions.
2517

26-
<!--
27-
You can also correct spelling errors in the **Test** panel by [entering the key](luis-interactive-test.md#view-bing-spell-check-corrections-in-test-panel). The key is kept as a session variable in the browser for the Test panel. Add the key to the Test panel in each browser session you want spelling corrected.
18+
Use [Bing Spell Check](../bing-spell-check/overview.md) to correct text before sending it to LUIS.
2819

29-
Usage of the key in the test panel and at the endpoint count toward the [key usage](https://azure.microsoft.com/pricing/details/cognitive-services/spellcheck-api/) quota. LUIS implements Bing Spell Check limits for text length.
20+
### Prior to V3 runtime
3021

31-
-->
22+
LUIS uses [Bing Spell Check API V7](../Bing-Spell-Check/overview.md) to correct spelling errors in the utterance. LUIS needs the key associated with that service. Create the key, then add the key as a querystring parameter at the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356).
3223

3324
The endpoint requires two params for spelling corrections to work:
3425

@@ -54,7 +45,7 @@ When [Bing Spell Check API V7](https://azure.microsoft.com/services/cognitive-se
5445
```
5546

5647
#### [V3 prediction endpoint response](#tab/V3)
57-
48+
5849
```JSON
5950
{
6051
"query": "Book a flite to London?",
@@ -71,16 +62,16 @@ When [Bing Spell Check API V7](https://azure.microsoft.com/services/cognitive-se
7162
}
7263
```
7364

74-
* * *
65+
* * *
7566

7667
### List of allowed words
7768
The Bing spell check API used in LUIS does not support a list of words to ignore during the spell check alterations. If you need to allow a list of words or acronyms, process the utterance in the client application before sending the utterance to LUIS for intent prediction.
7869

7970
## Change time zone of prebuilt datetimeV2 entity
80-
When a LUIS app uses the prebuilt [datetimeV2](luis-reference-prebuilt-datetimev2.md) entity, a datetime value can be returned in the prediction response. The timezone of the request is used to determine the correct datetime to return. If the request is coming from a bot or another centralized application before getting to LUIS, correct the timezone LUIS uses.
71+
When a LUIS app uses the prebuilt [datetimeV2](luis-reference-prebuilt-datetimev2.md) entity, a datetime value can be returned in the prediction response. The timezone of the request is used to determine the correct datetime to return. If the request is coming from a bot or another centralized application before getting to LUIS, correct the timezone LUIS uses.
8172

8273
### Endpoint querystring parameter
83-
The timezone is corrected by adding the user's timezone to the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356) using the `timezoneOffset` param. The value of `timezoneOffset` should be the positive or negative number, in minutes, to alter the time.
74+
The timezone is corrected by adding the user's timezone to the [endpoint](https://go.microsoft.com/fwlink/?linkid=2092356) using the `timezoneOffset` param. The value of `timezoneOffset` should be the positive or negative number, in minutes, to alter the time.
8475

8576
|Param|Value|
8677
|--|--|
@@ -91,11 +82,11 @@ If you need the returned prebuilt datetimeV2 to adjust for daylight savings time
9182

9283
#### [V2 prediction endpoint request](#tab/V2)
9384

94-
Add 60 minutes:
85+
Add 60 minutes:
9586

9687
https://{region}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q=Turn the lights on?**timezoneOffset=60**&verbose={boolean}&spellCheck={boolean}&staging={boolean}&bing-spell-check-subscription-key={string}&log={boolean}
9788

98-
Remove 60 minutes:
89+
Remove 60 minutes:
9990

10091
https://{region}.api.cognitive.microsoft.com/luis/v2.0/apps/{appId}?q=Turn the lights on?**timezoneOffset=-60**&verbose={boolean}&spellCheck={boolean}&staging={boolean}&bing-spell-check-subscription-key={string}&log={boolean}
10192

@@ -105,13 +96,13 @@ Add 60 minutes:
10596

10697
https://{region}.api.cognitive.microsoft.com/luis/v3.0-preview/apps/{appId}/slots/production/predict?query=Turn the lights on?**timezoneOffset=60**&spellCheck={boolean}&bing-spell-check-subscription-key={string}&log={boolean}
10798

108-
Remove 60 minutes:
99+
Remove 60 minutes:
109100

110101
https://{region}.api.cognitive.microsoft.com/luis/v3.0-preview/apps/{appId}/slots/production/predict?query=Turn the lights on?**timezoneOffset=-60**&spellCheck={boolean}&bing-spell-check-subscription-key={string}&log={boolean}
111102

112103
Learn more about the [V3 prediction endpoint](luis-migration-api-v3.md).
113104

114-
* * *
105+
* * *
115106

116107
## C# code determines correct value of timezoneOffset
117108
The following C# code uses the [TimeZoneInfo](https://docs.microsoft.com/dotnet/api/system.timezoneinfo) class's [FindSystemTimeZoneById](https://docs.microsoft.com/dotnet/api/system.timezoneinfo.findsystemtimezonebyid#examples) method to determine the correct `timezoneOffset` based on system time:
Lines changed: 13 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
---
22
title: Test app in LUIS portal
3-
titleSuffix: Azure Cognitive Services
43
description: Use Language Understanding (LUIS) to continuously work on your application to refine it and improve its language understanding.
5-
services: cognitive-services
6-
author: diberry
7-
manager: nitinme
8-
ms.custom: seodec18
9-
ms.service: cognitive-services
10-
ms.subservice: language-understanding
114
ms.topic: conceptual
125
ms.date: 11/19/2019
13-
ms.author: diberry
146
---
157

168
# Test your LUIS app in the LUIS portal
179

18-
[Testing](luis-concept-test.md) an app is an iterative process. After training your LUIS app, test it with sample utterances to see if the intents and entities are recognized correctly. If they're not, make updates to the LUIS app, train, and test again.
10+
[Testing](luis-concept-test.md) an app is an iterative process. After training your LUIS app, test it with sample utterances to see if the intents and entities are recognized correctly. If they're not, make updates to the LUIS app, train, and test again.
1911

2012
[!INCLUDE [Uses preview portal](includes/uses-portal-preview.md)]
2113

@@ -27,13 +19,13 @@ ms.author: diberry
2719

2820
## Train before testing
2921

30-
In order to test against the most recent version of the active app, select **Train** from the top menu, before testing.
22+
In order to test against the most recent version of the active app, select **Train** from the top menu, before testing.
3123

3224
## Test an utterance
3325

34-
The test utterance should not be exactly the same as any example utterances in the app. The test utterance should include word choice, phrase length, and entity usage you expect for a user.
26+
The test utterance should not be exactly the same as any example utterances in the app. The test utterance should include word choice, phrase length, and entity usage you expect for a user.
3527

36-
1. Access your app by selecting its name on the **My Apps** page.
28+
1. Access your app by selecting its name on the **My Apps** page.
3729

3830
1. To access the **Test** slide-out panel, select **Test** in your application's top panel.
3931

@@ -48,9 +40,9 @@ The test utterance should not be exactly the same as any example utterances in t
4840

4941
## Inspect score
5042

51-
You inspect details of the test result in the **Inspect** panel.
52-
53-
1. With the **Test** slide-out panel open, select **Inspect** for an utterance you want to compare.
43+
You inspect details of the test result in the **Inspect** panel.
44+
45+
1. With the **Test** slide-out panel open, select **Inspect** for an utterance you want to compare.
5446

5547
![Select Inspect button to see more details about the test results](./media/luis-how-to-interactive-test/inspect.png)
5648

@@ -68,7 +60,7 @@ You inspect details of the test result in the **Inspect** panel.
6860

6961
## View sentiment results
7062

71-
If **Sentiment analysis** is configured on the **[Publish](luis-how-to-publish-app.md#enable-sentiment-analysis)** page, the test results include the sentiment found in the utterance.
63+
If **Sentiment analysis** is configured on the **[Publish](luis-how-to-publish-app.md#enable-sentiment-analysis)** page, the test results include the sentiment found in the utterance.
7264

7365
![Image of Test pane with sentiment analysis](./media/luis-how-to-interactive-test/sentiment.png)
7466

@@ -78,7 +70,7 @@ If you are using [Patterns](luis-concept-patterns.md) and the utterance matched
7870

7971
## Compare with published version
8072

81-
You can test the active version of your app with the published [endpoint](luis-glossary.md#endpoint) version. In the **Inspect** panel, select **Compare with published**. Any testing against the published model is deducted from your Azure subscription quota balance.
73+
You can test the active version of your app with the published [endpoint](luis-glossary.md#endpoint) version. In the **Inspect** panel, select **Compare with published**. Any testing against the published model is deducted from your Azure subscription quota balance.
8274

8375
![Compare with published](./media/luis-how-to-interactive-test/inspect-panel-compare.png)
8476

@@ -87,55 +79,22 @@ You can view the endpoint JSON returned for the comparison by selecting the **Sh
8779

8880
![Published JSON response](./media/luis-how-to-interactive-test/inspect-panel-compare-json.png)
8981

90-
<!--Service name is 'Bing Spell Check v7 API' in the portal-->
9182
## Additional settings in test panel
9283

9384
### LUIS endpoint
9485

95-
If you have several LUIS endpoints, use the **Additional Settings** link on the Test's Published pane to change the endpoint used for testing. If you are not sure which endpoint to use, select the default **Starter_Key**.
86+
If you have several LUIS endpoints, use the **Additional Settings** link on the Test's Published pane to change the endpoint used for testing. If you are not sure which endpoint to use, select the default **Starter_Key**.
9687

9788
> [!div class="mx-imgBorder"]
9889
> ![Test panel with Additional Settings link highlighted](media/luis-how-to-interactive-test/additional-settings-v3-settings.png)
9990
100-
<!--
101-
### View Bing Spell Check corrections in test panel
102-
103-
Requirements to view the spelling corrections:
104-
105-
* Published app
106-
* Bing Spell Check [service key](https://azure.microsoft.com/try/cognitive-services/?api=spellcheck-api). The service key is not stored and needs to be reset for each browser session.
107-
108-
Use the following procedure to include the [Bing Spell Check v7](https://azure.microsoft.com/services/cognitive-services/spell-check/) service in the Test pane results.
109-
110-
1. In the **Test** pane, enter an utterance. When the utterance is predicted, select **[Inspect](#inspect-score)** underneath the utterance you entered.
111-
112-
1. When the **Inspect** panel opens, select **[Compare with Published](#compare-with-published-version)**.
113-
114-
1. When the **Published** panel opens, select **[Additional Settings](#additional-settings-in-test-panel)**.
115-
116-
1. In the pop-up dialog, check **Enable Bing Spell Check** and enter the key, then select **Done**.
117-
![Enter Bing Spell Check service key](./media/luis-how-to-interactive-test/interactive-with-spell-check-service-key-text.png)
118-
119-
1. Enter a query with an incorrect spelling such as `book flite to seattle` and select enter. The incorrect spelling of the word `flite` is replaced in the query sent to LUIS and the resulting JSON shows both the original query, as `query`, and the corrected spelling in the query, as `alteredQuery`.
120-
121-
<a name="json-file-with-no-duplicates"></a>
122-
<a name="import-a-dataset-file-for-batch-testing"></a>
123-
<a name="export-rename-delete-or-download-dataset"></a>
124-
<a name="run-a-batch-test-on-your-trained-app"></a>
125-
<a name="access-batch-test-result-details-in-a-visualized-view"></a>
126-
<a name="filter-chart-results-by-intent-or-entity"></a>
127-
<a name="investigate-false-sections"></a>
128-
<a name="view single-point utterance data"></a>
129-
<a name="relabel-utterances-and-retrain"></a>
130-
<a name="false-test-results"></a>
131-
-->
13291

13392
## Batch testing
13493
See batch testing [concepts](luis-concept-batch-test.md) and learn [how to](luis-how-to-batch-test.md) test a batch of utterances.
13594

13695
## Next steps
13796

138-
If testing indicates that your LUIS app doesn't recognize the correct intents and entities, you can work to improve your LUIS app's accuracy by labeling more utterances or adding features.
97+
If testing indicates that your LUIS app doesn't recognize the correct intents and entities, you can work to improve your LUIS app's accuracy by labeling more utterances or adding features.
13998

140-
* [Label suggested utterances with LUIS](luis-how-to-review-endpoint-utterances.md)
141-
* [Use features to improve your LUIS app's performance](luis-how-to-add-features.md)
99+
* [Label suggested utterances with LUIS](luis-how-to-review-endpoint-utterances.md)
100+
* [Use features to improve your LUIS app's performance](luis-how-to-add-features.md)

0 commit comments

Comments
 (0)