Skip to content

Commit 71f7b50

Browse files
committed
breaking SDK changes for LID mode
1 parent 463372d commit 71f7b50

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ For speech recognition, the initial latency is higher with language identificati
2727
## Configuration options
2828

2929
> [!IMPORTANT]
30-
> You must make a code change when upgrading to the Speech SDK version 1.25 from earlier versions. With Speech SDK version 1.25, the
30+
> Language Identification (preview) APIs have been simplified in the Speech SDK version 1.25. The
3131
`SpeechServiceConnection_SingleLanguageIdPriority` and `SpeechServiceConnection_ContinuousLanguageIdPriority` properties have
32-
been removed and replaced by a single property `SpeechServiceConnection_LanguageIdMode`. The Speech service will prioritize latency over accuracy for language identification.
32+
been removed and replaced by a single property `SpeechServiceConnection_LanguageIdMode`. Prioritizing between low latency and high accuracy is no longer necessary following recent model improvements. Results are very accurate at low latency, therefore we removed the priority option. The only setting supported now is whether to run at-start or continuous language identification, when doing continuous speech recognition or translation.
3333

3434
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.
3535

@@ -121,7 +121,7 @@ You'll either call the "recognize once" method, or the start and stop continuous
121121
- Continuous recognition with at-start LID
122122
- Continuous recognition with continuous LID
123123
124-
The `SpeechServiceConnection_LanguageIdMode` property is always required for continuous LID. Without it, the Speech service defaults to at-start lid. The supported values are "AtStart" for at-start LID or "Continuous" for continuous LID.
124+
The `SpeechServiceConnection_LanguageIdMode` property is only required for continuous LID. Without it, the Speech service defaults to at-start lid. The supported values are "AtStart" for at-start LID or "Continuous" for continuous LID.
125125
126126
::: zone pivot="programming-language-csharp"
127127
@@ -213,8 +213,8 @@ using Microsoft.CognitiveServices.Speech.Audio;
213213
214214
var speechConfig = SpeechConfig.FromSubscription("YourSubscriptionKey","YourServiceRegion");
215215
216-
// Set the LanguageIdMode (Optional; Either Continuous or AtStart are accepted; Default AtStart)
217-
speechConfig.SetProperty(PropertyId.SpeechServiceConnection_LanguageIdMode, "Continuous");
216+
// Only at-start LID is supported when you use RecognizeOnceAsync, so this line isn't required.
217+
speechConfig.SetProperty(PropertyId.SpeechServiceConnection_LanguageIdMode, "AtStart");
218218
219219
var autoDetectSourceLanguageConfig =
220220
AutoDetectSourceLanguageConfig.FromLanguages(
@@ -336,8 +336,8 @@ using namespace Microsoft::CognitiveServices::Speech::Audio;
336336
337337
auto speechConfig = SpeechConfig::FromSubscription("YourSubscriptionKey","YourServiceRegion");
338338
339-
// Set the LanguageIdMode (Optional; Either Continuous or AtStart are accepted; Default AtStart)
340-
speechConfig->SetProperty(PropertyId::SpeechServiceConnection_LanguageIdMode, "Continuous");
339+
// Only at-start LID is supported when you use RecognizeOnceAsync, so this line isn't required.
340+
speechConfig->SetProperty(PropertyId::SpeechServiceConnection_LanguageIdMode, "AtStart");
341341
342342
auto autoDetectSourceLanguageConfig =
343343
AutoDetectSourceLanguageConfig::FromLanguages({ "en-US", "de-DE", "zh-CN" });
@@ -614,8 +614,8 @@ public static async Task RecognizeOnceSpeechTranslationAsync()
614614
615615
var config = SpeechTranslationConfig.FromEndpoint(endpointUrl, "YourSubscriptionKey");
616616
617-
// Set the LanguageIdMode (Optional; Either Continuous or AtStart are accepted; Default AtStart)
618-
speechTranslationConfig.SetProperty(PropertyId.SpeechServiceConnection_LanguageIdMode, "Continuous");
617+
// Only at-start LID is supported when you use RecognizeOnceAsync, so this line isn't required.
618+
speechTranslationConfig.SetProperty(PropertyId.SpeechServiceConnection_LanguageIdMode, "AtStart");
619619
620620
// Source language is required, but currently ignored.
621621
string fromLanguage = "en-US";
@@ -774,8 +774,8 @@ auto region = "YourServiceRegion";
774774
auto endpointString = std::format("wss://{}.stt.speech.microsoft.com/speech/universal/v2", region);
775775
auto config = SpeechTranslationConfig::FromEndpoint(endpointString, "YourSubscriptionKey");
776776
777-
// Set the LanguageIdMode (Optional; Either Continuous or AtStart are accepted; Default AtStart)
778-
config->SetProperty(PropertyId::SpeechServiceConnection_LanguageIdMode, "Continuous");
777+
// Only at-start LID is supported when you use RecognizeOnceAsync, so this line isn't required.
778+
config->SetProperty(PropertyId::SpeechServiceConnection_LanguageIdMode, "AtStart");
779779
auto autoDetectSourceLanguageConfig = AutoDetectSourceLanguageConfig::FromLanguages({ "en-US", "de-DE" });
780780
781781
// Sets source and target languages
@@ -953,7 +953,7 @@ translation_config = speechsdk.translation.SpeechTranslationConfig(
953953
target_languages=('de', 'fr'))
954954
audio_config = speechsdk.audio.AudioConfig(filename=weatherfilename)
955955
956-
# Set the LanguageIdMode (Optional; Either Continuous or AtStart are accepted; Default AtStart)
956+
# Only at-start LID is supported when you use RecognizeOnceAsync, so this line isn't required.
957957
translation_config.set_property(property_id=speechsdk.PropertyId.SpeechServiceConnection_LanguageIdMode, value='AtStart')
958958
959959
# Specify the AutoDetectSourceLanguageConfig, which defines the number of possible languages

0 commit comments

Comments
 (0)