How should you complete the code?

HOTSPOT

You are developing a service that records lectures given in English (United Kingdom).

You have a method named AppendToTranscriptFile that takes translated text and a language identifier.

You need to develop code that will provide transcripts of the lectures to attendees in their respective language. The supported languages are English, French, Spanish, and German.

How should you complete the code? To answer, select the appropriate options in the answer area. NOTE: Each correct selection is worth one point.

Answer:

Explanation:

Box 1: {"fr", "de", "es"}

A common task of speech translation is to specify target translation languages, at least one is required but multiples are supported. The following code snippet sets both French and German as translation language targets.

static async Task TranslateSpeechAsync()

{

var translationConfig =

SpeechTranslationConfig.FromSubscription(SPEECH__SUBSCRIPTION__KEY, SPEECH__SERVICE__REGION);

translationConfig.SpeechRecognitionLanguage = "it-IT";

// Translate to languages. See, https://aka.ms/speech/sttt-languages

translationConfig.AddTargetLanguage("fr");

translationConfig.AddTargetLanguage("de");

}

Box 2: TranslationRecognizer

After you’ve created a SpeechTranslationConfig, the next step is to initialize a TranslationRecognizer.

Example code:

static async Task TranslateSpeechAsync()

{

var translationConfig =

SpeechTranslationConfig.FromSubscription(SPEECH__SUBSCRIPTION__KEY, SPEECH__SERVICE__REGION);

var fromLanguage = "en-US";

var toLanguages = new List<string> { "it", "fr", "de" };

translationConfig.SpeechRecognitionLanguage = fromLanguage;

toLanguages.ForEach(translationConfig.AddTargetLanguage);

using var recognizer = new TranslationRecognizer(translationConfig);

}

Latest AI-102 Dumps Valid Version with 80 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments