You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,15 +19,14 @@ Language identification is used to identify languages spoken in audio when compa
19
19
20
20
Language identification (LID) use cases include:
21
21
22
-
*[Standalone language identification](#standalone-language-identification) when you only need to identify the language in an audio source.
23
22
*[Speech-to-text recognition](#speech-to-text) when you need to identify the language in an audio source and then transcribe it to text.
24
23
*[Speech translation](#speech-translation) when you need to identify the language in an audio source and then translate it to another language.
25
24
26
25
Note that for speech recognition, the initial latency is higher with language identification. You should only include this optional feature as needed.
27
26
28
27
## Configuration options
29
28
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.
31
30
32
31
- Define a list of [candidate languages](#candidate-languages) that you expect in the audio.
33
32
- 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.
111
110
112
111
> [!NOTE]
113
112
> 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
+
114
114
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.
115
115
116
116
* **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.
118
118
119
119
> [!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
+
121
122
Speech uses at-start LID with `Latency` prioritization by default. You need to set a priority property for any other LID configuration.
122
123
123
124
::: zone pivot="programming-language-csharp"
@@ -169,6 +170,7 @@ Language identification is completed with recognition objects and operations. Yo
169
170
170
171
> [!NOTE]
171
172
> Don't confuse recognition with identification. Recognition can be used with or without language identification.
173
+
172
174
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:
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).
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).
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).
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/
351
299
var endpointUrl = new Uri(endpointString);
352
300
353
301
var config = SpeechConfig.FromEndpoint(endpointUrl, "YourSubscriptionKey");
354
-
// can switch "Latency" to "Accuracy" depending on priority
0 commit comments