Skip to content

Commit d4be459

Browse files
committed
clu updates
1 parent a9f68b3 commit d4be459

File tree

3 files changed

+96
-21
lines changed

3 files changed

+96
-21
lines changed

articles/cognitive-services/Speech-Service/includes/quickstarts/intent-recognition-clu/cpp.md

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ Follow these steps to create a new console application and install the Speech SD
9494
{
9595
std::cout << "RECOGNIZED: Text=" << result->Text << std::endl;
9696
std::cout << " Intent Id: " << result->IntentId << std::endl;
97-
98-
// There is a known issue with the LanguageUnderstandingServiceResponse_JsonResult
99-
// property when used with CLU in the Speech SDK version 1.25.
100-
// The following should return JSON in a future release.
10197
std::cout << " Intent Service JSON: " << result->Properties.GetProperty(PropertyId::LanguageUnderstandingServiceResponse_JsonResult) << std::endl;
10298
}
10399
else if (result->Reason == ResultReason::RecognizedSpeech)
@@ -152,14 +148,56 @@ Follow these steps to create a new console application and install the Speech SD
152148
Speak into your microphone when prompted. What you speak should be output as text:
153149
154150
```console
155-
Say something ...
156-
RECOGNIZED: Text=Go ahead and delete the e-mail.
157-
Intent Id: Delete.
158-
Language Understanding JSON:
151+
Speak into your microphone.
152+
RECOGNIZED: Text=Turn on the lights.
153+
Intent Id: HomeAutomation.TurnOn.
154+
Language Understanding JSON: {"kind":"ConversationResult","result":{"query":"turn on the lights","prediction":{"topIntent":"HomeAutomation.TurnOn","projectKind":"Conversation","intents":[{"category":"HomeAutomation.TurnOn","confidenceScore":0.97712576},{"category":"HomeAutomation.TurnOff","confidenceScore":0.8431633},{"category":"None","confidenceScore":0.782861}],"entities":[{"category":"HomeAutomation.DeviceType","text":"lights","offset":12,"length":6,"confidenceScore":1,"extraInformation":[{"extraInformationKind":"ListKey","key":"light"}]}]}}}.
159155
```
160156

161-
> [NOTE]
162-
> There is a known issue with the LanguageUnderstandingServiceResponse_JsonResult property when used with CLU in the Speech SDK version 1.25. You can get detailed JSON output in a future release. Via JSON, the intents are returned in the probability order of most likely to least likely. For example, the `topIntent` might be `Delete` with a confidence score of 0.95413816 (95.41%). The second most likely intent might be `Cancel` with a confidence score of 0.8985081 (89.85%).
157+
158+
The intents are returned in the probability order of most likely to least likely. Here's a formatted version of the JSON output where the `topIntent` is `HomeAutomation.TurnOn` with a confidence score of 0.97712576 (97.71%). The second most likely intent might be `HomeAutomation.TurnOff` with a confidence score of 0.8985081 (84.31%).
159+
160+
```json
161+
{
162+
"kind": "ConversationResult",
163+
"result": {
164+
"query": "turn on the lights",
165+
"prediction": {
166+
"topIntent": "HomeAutomation.TurnOn",
167+
"projectKind": "Conversation",
168+
"intents": [
169+
{
170+
"category": "HomeAutomation.TurnOn",
171+
"confidenceScore": 0.97712576
172+
},
173+
{
174+
"category": "HomeAutomation.TurnOff",
175+
"confidenceScore": 0.8431633
176+
},
177+
{
178+
"category": "None",
179+
"confidenceScore": 0.782861
180+
}
181+
],
182+
"entities": [
183+
{
184+
"category": "HomeAutomation.DeviceType",
185+
"text": "lights",
186+
"offset": 12,
187+
"length": 6,
188+
"confidenceScore": 1,
189+
"extraInformation": [
190+
{
191+
"extraInformationKind": "ListKey",
192+
"key": "light"
193+
}
194+
]
195+
}
196+
]
197+
}
198+
}
199+
}
200+
```
163201

164202
## Remarks
165203
Now that you've completed the quickstart, here are some additional considerations:

articles/cognitive-services/Speech-Service/includes/quickstarts/intent-recognition-clu/csharp.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,6 @@ Follow these steps to create a new console application and install the Speech SD
8989
{
9090
Console.WriteLine($"RECOGNIZED: Text={recognitionResult.Text}");
9191
Console.WriteLine($" Intent Id: {recognitionResult.IntentId}.");
92-
93-
// There is a known issue with the LanguageUnderstandingServiceResponse_JsonResult
94-
// property when used with CLU in the Speech SDK version 1.25.
95-
// The following should return JSON in a future release.
9692
Console.WriteLine($" Language Understanding JSON: {recognitionResult.Properties.GetProperty(PropertyId.LanguageUnderstandingServiceResponse_JsonResult)}.");
9793
}
9894
else if (recognitionResult.Reason == ResultReason.RecognizedSpeech)
@@ -136,14 +132,55 @@ dotnet run
136132
Speak into your microphone when prompted. What you speak should be output as text:
137133

138134
```console
139-
Say something ...
140-
RECOGNIZED: Text=Go ahead and delete the e-mail.
141-
Intent Id: Delete.
142-
Language Understanding JSON:
135+
Speak into your microphone.
136+
RECOGNIZED: Text=Turn on the lights.
137+
Intent Id: HomeAutomation.TurnOn.
138+
Language Understanding JSON: {"kind":"ConversationResult","result":{"query":"turn on the lights","prediction":{"topIntent":"HomeAutomation.TurnOn","projectKind":"Conversation","intents":[{"category":"HomeAutomation.TurnOn","confidenceScore":0.97712576},{"category":"HomeAutomation.TurnOff","confidenceScore":0.8431633},{"category":"None","confidenceScore":0.782861}],"entities":[{"category":"HomeAutomation.DeviceType","text":"lights","offset":12,"length":6,"confidenceScore":1,"extraInformation":[{"extraInformationKind":"ListKey","key":"light"}]}]}}}.
143139
```
144140

145-
> [NOTE]
146-
> There is a known issue with the LanguageUnderstandingServiceResponse_JsonResult property when used with CLU in the Speech SDK version 1.25. You can get detailed JSON output in a future release. Via JSON, the intents are returned in the probability order of most likely to least likely. For example, the `topIntent` might be `Delete` with a confidence score of 0.95413816 (95.41%). The second most likely intent might be `Cancel` with a confidence score of 0.8985081 (89.85%).
141+
The intents are returned in the probability order of most likely to least likely. Here's a formatted version of the JSON output where the `topIntent` is `HomeAutomation.TurnOn` with a confidence score of 0.97712576 (97.71%). The second most likely intent might be `HomeAutomation.TurnOff` with a confidence score of 0.8985081 (84.31%).
142+
143+
```json
144+
{
145+
"kind": "ConversationResult",
146+
"result": {
147+
"query": "turn on the lights",
148+
"prediction": {
149+
"topIntent": "HomeAutomation.TurnOn",
150+
"projectKind": "Conversation",
151+
"intents": [
152+
{
153+
"category": "HomeAutomation.TurnOn",
154+
"confidenceScore": 0.97712576
155+
},
156+
{
157+
"category": "HomeAutomation.TurnOff",
158+
"confidenceScore": 0.8431633
159+
},
160+
{
161+
"category": "None",
162+
"confidenceScore": 0.782861
163+
}
164+
],
165+
"entities": [
166+
{
167+
"category": "HomeAutomation.DeviceType",
168+
"text": "lights",
169+
"offset": 12,
170+
"length": 6,
171+
"confidenceScore": 1,
172+
"extraInformation": [
173+
{
174+
"extraInformationKind": "ListKey",
175+
"key": "light"
176+
}
177+
]
178+
}
179+
]
180+
}
181+
}
182+
}
183+
```
147184

148185
## Remarks
149186
Now that you've completed the quickstart, here are some additional considerations:

articles/cognitive-services/Speech-Service/includes/quickstarts/intent-recognition-clu/deploy-clu-model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Go to the [Language Studio](https://aka.ms/languageStudio) and sign in with your
1313

1414
### Create a conversational language understanding project
1515

16-
For this quickstart, you can download [this sample project](https://go.microsoft.com/fwlink/?linkid=2196152) and import it. This project can predict the intended commands from user input, such as: reading emails, deleting emails, and attaching a document to an email.
16+
For this quickstart, you can download [this sample home automation project](https://github.com/Azure-Samples/cognitive-services-sample-data-files/blob/master/language-service/CLU/HomeAutomationDemo.json) and import it. This project can predict the intended commands from user input, such as turning lights on and off.
1717

1818
[!INCLUDE [Import project](../../../../language-service/conversational-language-understanding/includes/language-studio/import-project.md)]
1919

0 commit comments

Comments
 (0)