Skip to content

Commit c87044e

Browse files
Merge pull request #223733 from eric-urban/eur/lid-updates
remove standalone LID from public preview
2 parents c55eb8a + f367f8b commit c87044e

File tree

1 file changed

+9
-63
lines changed

1 file changed

+9
-63
lines changed

articles/cognitive-services/Speech-Service/language-identification.md

Lines changed: 9 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ manager: nitinme
88
ms.service: cognitive-services
99
ms.subservice: speech-service
1010
ms.topic: how-to
11-
ms.date: 09/16/2022
11+
ms.date: 01/12/2023
1212
ms.author: eur
1313
zone_pivot_groups: programming-languages-speech-services-nomore-variant
1414
---
@@ -19,15 +19,14 @@ Language identification is used to identify languages spoken in audio when compa
1919

2020
Language identification (LID) use cases include:
2121

22-
* [Standalone language identification](#standalone-language-identification) when you only need to identify the language in an audio source.
2322
* [Speech-to-text recognition](#speech-to-text) when you need to identify the language in an audio source and then transcribe it to text.
2423
* [Speech translation](#speech-translation) when you need to identify the language in an audio source and then translate it to another language.
2524

2625
Note that for speech recognition, the initial latency is higher with language identification. You should only include this optional feature as needed.
2726

2827
## Configuration options
2928

30-
Whether you use language identification [on its own](#standalone-language-identification), with [speech-to-text](#speech-to-text), or with [speech translation](#speech-translation), there are some common concepts and configuration options.
29+
Whether you use language identification with [speech-to-text](#speech-to-text) or with [speech translation](#speech-translation), there are some common concepts and configuration options.
3130

3231
- Define a list of [candidate languages](#candidate-languages) that you expect in the audio.
3332
- Decide whether to use [at-start or continuous](#at-start-and-continuous-language-identification) language identification.
@@ -111,13 +110,15 @@ You can choose to prioritize accuracy or latency with language identification.
111110
112111
> [!NOTE]
113112
> Latency is prioritized by default with the Speech SDK. You can choose to prioritize accuracy or latency with the Speech SDKs for C#, C++, Java ([for speech to text only](#speech-to-text)), and Python.
113+
114114
Prioritize `Latency` if you need a low-latency result such as during live streaming. Set the priority to `Accuracy` if the audio quality may be poor, and more latency is acceptable. For example, a voicemail could have background noise, or some silence at the beginning. Allowing the engine more time will improve language identification results.
115115
116116
* **At-start:** With at-start LID in `Latency` mode the result is returned in less than 5 seconds. With at-start LID in `Accuracy` mode the result is returned within 30 seconds. You set the priority for at-start LID with the `SpeechServiceConnection_SingleLanguageIdPriority` property.
117-
* **Continuous:** With continuous LID in `Latency` mode the results are returned every 2 seconds for the duration of the audio. With continuous LID in `Accuracy` mode the results are returned within no set time frame for the duration of the audio. You set the priority for continuous LID with the `SpeechServiceConnection_ContinuousLanguageIdPriority` property.
117+
* **Continuous:** With continuous LID in `Latency` mode the results are returned every 2 seconds for the duration of the audio. Continuous LID in `Accuracy` mode isn't supported with [speech-to-text](#speech-to-text) and [speech translation](#speech-translation) continuous recognition.
118118
119119
> [!IMPORTANT]
120-
> With [speech-to-text](#speech-to-text) and [speech translation](#speech-translation) continuous recognition, do not set `Accuracy`with the SpeechServiceConnection_ContinuousLanguageIdPriority property. The setting will be ignored without error, and the default priority of `Latency` will remain in effect. Only [standalone language identification](#standalone-language-identification) supports continuous LID with `Accuracy` prioritization.
120+
> With [speech-to-text](#speech-to-text) and [speech translation](#speech-translation) continuous recognition, do not set `Accuracy` with the SpeechServiceConnection_ContinuousLanguageIdPriority property. The setting will be ignored without error, and the default priority of `Latency` will remain in effect.
121+
121122
Speech uses at-start LID with `Latency` prioritization by default. You need to set a priority property for any other LID configuration.
122123
123124
::: zone pivot="programming-language-csharp"
@@ -169,6 +170,7 @@ Language identification is completed with recognition objects and operations. Yo
169170
170171
> [!NOTE]
171172
> Don't confuse recognition with identification. Recognition can be used with or without language identification.
173+
172174
Let's map these concepts to the code. You will either call the recognize once method, or the start and stop continuous recognition methods. You choose from:
173175
174176
- Recognize once with at-start LID
@@ -246,60 +248,6 @@ recognizer.stop_continuous_recognition()
246248
247249
::: zone-end
248250
249-
## Standalone language identification
250-
251-
You use standalone language identification when you only need to identify the language in an audio source.
252-
253-
> [!NOTE]
254-
> Standalone source language identification is only supported with the Speech SDKs for C#, C++, and Python.
255-
::: zone pivot="programming-language-csharp"
256-
257-
See more examples of standalone language identification on [GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/csharp/sharedcontent/console/standalone_language_detection_samples.cs).
258-
259-
### [Recognize once](#tab/once)
260-
261-
:::code language="csharp" source="~/samples-cognitive-services-speech-sdk/samples/csharp/sharedcontent/console/standalone_language_detection_samples.cs" id="languageDetectionInAccuracyWithFile":::
262-
263-
### [Continuous recognition](#tab/continuous)
264-
265-
:::code language="csharp" source="~/samples-cognitive-services-speech-sdk/samples/csharp/sharedcontent/console/standalone_language_detection_samples.cs" id="languageDetectionContinuousWithFile":::
266-
267-
---
268-
269-
::: zone-end
270-
271-
::: zone pivot="programming-language-cpp"
272-
273-
See more examples of standalone language identification on [GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/cpp/windows/console/samples/standalone_language_detection_samples.cpp).
274-
275-
### [Recognize once](#tab/once)
276-
277-
:::code language="cpp" source="~/samples-cognitive-services-speech-sdk/samples/cpp/windows/console/samples/standalone_language_detection_samples.cpp" id="StandaloneLanguageDetectionWithMicrophone":::
278-
279-
### [Continuous recognition](#tab/continuous)
280-
281-
:::code language="cpp" source="~/samples-cognitive-services-speech-sdk/samples/cpp/windows/console/samples/standalone_language_detection_samples.cpp" id="StandaloneLanguageDetectionInContinuousModeWithFileInput":::
282-
283-
---
284-
285-
::: zone-end
286-
287-
::: zone pivot="programming-language-python"
288-
289-
See more examples of standalone language identification on [GitHub](https://github.com/Azure-Samples/cognitive-services-speech-sdk/blob/master/samples/python/console/speech_language_detection_sample.py).
290-
291-
### [Recognize once](#tab/once)
292-
293-
:::code language="python" source="~/samples-cognitive-services-speech-sdk/samples/python/console/speech_language_detection_sample.py" id="SpeechLanguageDetectionWithFile":::
294-
295-
### [Continuous recognition](#tab/continuous)
296-
297-
:::code language="python" source="~/samples-cognitive-services-speech-sdk/samples/python/console/speech_language_detection_sample.py" id="SpeechContinuousLanguageDetectionWithFile":::
298-
299-
---
300-
301-
::: zone-end
302-
303251
## Speech-to-text
304252
305253
You use Speech-to-text recognition when you need to identify the language in an audio source and then transcribe it to text. For more information, see [Speech-to-text overview](speech-to-text.md).
@@ -351,7 +299,6 @@ var endpointString = $"wss://{region}.stt.speech.microsoft.com/speech/universal/
351299
var endpointUrl = new Uri(endpointString);
352300
353301
var config = SpeechConfig.FromEndpoint(endpointUrl, "YourSubscriptionKey");
354-
// can switch "Latency" to "Accuracy" depending on priority
355302
config.SetProperty(PropertyId.SpeechServiceConnection_ContinuousLanguageIdPriority, "Latency");
356303
357304
var autoDetectSourceLanguageConfig = AutoDetectSourceLanguageConfig.FromLanguages(new string[] { "en-US", "de-DE", "zh-CN" });
@@ -498,7 +445,6 @@ result.close();
498445

499446
---
500447

501-
502448
::: zone-end
503449

504450
::: zone pivot="programming-language-python"
@@ -1112,8 +1058,8 @@ translation_config = speechsdk.translation.SpeechTranslationConfig(
11121058
target_languages=('de', 'fr'))
11131059
audio_config = speechsdk.audio.AudioConfig(filename=weatherfilename)
11141060

1115-
# Set the Priority (optional, default Latency, either Latency or Accuracy is accepted)
1116-
translation_config.set_property(property_id=speechsdk.PropertyId.SpeechServiceConnection_SingleLanguageIdPriority, value='Accuracy')
1061+
# Set the Priority (optional, default Latency)
1062+
translation_config.set_property(property_id=speechsdk.PropertyId.SpeechServiceConnection_SingleLanguageIdPriority, value='Latency')
11171063

11181064
# Specify the AutoDetectSourceLanguageConfig, which defines the number of possible languages
11191065
auto_detect_source_language_config = speechsdk.languageconfig.AutoDetectSourceLanguageConfig(languages=["en-US", "de-DE", "zh-CN"])

0 commit comments

Comments
 (0)