ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 57 - AI-102 discussion

Report
Export

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.

Question 57
Correct answer: Question 57

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);

}

asked 26/09/2024
German Dario Jara
32 questions
User
0 comments
Sorted by

Leave a comment first