Exam AI-102 All QuestionsBrowse all questions from this exam
Question 116

HOTSPOT -

You are developing an application that includes language translation.

The application will translate text retrieved by using a function named getTextToBeTranslated. The text can be in one of many languages. The content of the text must remain within the Americas Azure geography.

You need to develop code to translate the text to a single language.

How should you complete the code? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Hot Area:

    Correct Answer:

Discussion
Shourya007

Wrong , correct answer is both last option. api-nam.cognitive.microsofttranslator.com '?to=en'

ExamDev

Box 1: api-nam/translate : https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference#base-urls Box 2: "?to=en";

zellck

1. api-nam.cognitive.microsofttranslator.com 2. ?to=en' https://learn.microsoft.com/en-us/azure/cognitive-services/Translator/reference/v3-0-reference#base-urls Requests to Translator are, in most cases, handled by the datacenter that is closest to where the request originated. If there's a datacenter failure when using the global endpoint, the request may be routed outside of the geography. To force the request to be handled within a specific geography, use the desired geographical endpoint. All requests are processed among the datacenters within the geography. - United States api-nam.cognitive.microsofttranslator.com https://learn.microsoft.com/en-us/azure/cognitive-services/translator/reference/rest-api-guide - translate Translate specified source language text into the target language text.

alan007

wrong for first choice,should be API.cognitive……./tanslate

SuperPetey

incorrect - the question specifies it should be routed to the Americas region. The correct answer for box 1 is api-nam.cognitive.microsofttranslator.com/translate according to doc @ https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference#base-urls I agree second drop-down is '?to=en'

rdemontis

agree with you. thanks for the provided reference

anto69

insane way to ask a question

eskimolight

Hhahhahha

Ravnit

Was on exam 27/11/2021

Adedoyin_Simeon

SuperPetey is correct. ref: https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference#base-urls

nanaw770

api-nam/translate to=en

katrang

api-nam....../translate ?to=en

PHD_CHENG

Was on exam 7 Jun 2022

funny_penguin

on exam, /translate and to=en

varinder82

Final Answer 1. /translate 2. to=en

RAN_L

var endpoint = "https://api-nam.cognitive.microsofttranslator.com/translate"; var apiKey = "FF956C68883821838691A8D200A4C606"; var text = getTextToBeTranslated(); var body = "[{\"Text\":\"" + text + "\"}]"; var client = new HttpClient(); client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", apiKey); var uri = endpoint + "?to=en"; var content = new StringContent(body, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PutAsync(uri, content); string translatedText = await response.Content.ReadAsStringAsync();

Eltooth

Box 1: api-nam/translate : https://docs.microsoft.com/en-us/azure/cognitive-services/translator/reference/v3-0-reference#base-urls Box 2: "?to=en";