Lesson 3 of 4 Text Analysis with Language Models and Foundry Tools

Translating Content with Azure Translator and Language Models

This lesson explains when to use Azure Translator, which provides fast, consistent machine translation, and when to use language models, which provide adaptive translation that follows style and context, and how to control terminology.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe text and document translation with Azure Translator.
  • Control terminology with glossaries, dictionaries and Custom Translator.
  • Design an LLM-powered translation flow.

Azure Translator

Azure Translator is the Foundry Tool for machine translation. It uses neural translation models trained specifically for translation, so it returns fast, consistent translations without prompts, priced per character. It is called on the Foundry resource endpoint with Microsoft Entra ID, and it offers two operations.

Text translation translates one or more strings into one or more target languages in a single request. It detects the source language automatically and supports transliteration and dictionary lookups.

Document translation translates whole files, such as Word, PowerPoint, PDF and HTML documents, asynchronously from a Blob Storage source container to a target container while preserving layout, which suits large batches.

r = requests.post(f"{ai_endpoint}/translator/text/v3.0/translate?api-version=3.0&to=de&to=fr",
                  json=[{"text": "Your order has shipped and will arrive on Friday."}], headers=bearer()).json()
for t in r[0]["translations"]:
    print(t["to"], t["text"])

Controlling terminology

Terminology control is a frequent requirement. Translator supports glossaries in document translation and dynamic dictionary markup for text, and Custom Translator trains a custom model on parallel documents in the domain, such as legal or medical texts, which improves terminology and phrasing across all requests. Terms that must never be translated, such as product names, can be protected with markup.

The options differ in what they control. A glossary is a list of exact term pairs, such as "claim" always translated as "Schadensfall" rather than "Anspruch" in an insurer's German documents; it fixes specific words but leaves the rest of the sentence to the general model. Custom Translator learns from thousands of previously translated sentence pairs, so it absorbs the domain's phrasing as well as its terms, which matters when a field such as patent law has its own sentence patterns; the cost is collecting the parallel documents and retraining when the domain changes. Markup that prevents translation handles a third case, text that must pass through unchanged, such as a product name or a code identifier.

A practical progression is to start with the general model and a glossary for the terms that matter most, measure the results with bilingual review, and invest in Custom Translator only when reviewers keep correcting phrasing that a glossary cannot fix.

LLM-powered translation flows

A language model translates with instructions about audience, tone, formality and length, follows a glossary provided in the prompt, adapts idioms and cultural references, and can translate and summarize in one step. Translator also offers translation through a selected Foundry model for adaptive quality. The following table compares the approaches.

Azure Translator
High volume at low costStrong
Whole documents with layout preservedDocument translation
Consistent terminology at scaleGlossaries, Custom Translator
Tone, style and cultural adaptationLimited
Repeatable outputYes
LLM translation flow
High volume at low costWeaker (per-token cost)
Whole documents with layout preservedRequires custom handling
Consistent terminology at scaleGlossary in the prompt
Tone, style and cultural adaptationStrong
Repeatable outputLess, even at low temperature

LLM translations are evaluated with bilingual reviewers or automatic metrics, and critical content, such as legal terms, is reviewed by people.

The Text Translation playground shows both approaches. The following screenshot shows a sentence translated into German with Azure-MT, the neural machine translation model, and the model list, which also offers the chat-primary deployment and other GPT models. Tone, gender and adaptive customization are available only with an LLM.

Text Translation playground with a German translation and a model list of Azure-MT, chat-primary and GPT models
Azure-MT gives fast, consistent translation; an LLM follows instructions about tone and terminology.
Sort into groups

Choose the translation approach

Exam skills 4.1.3

Choose the translation approach for each requirement.

Log in to try this activity Interactive activities are free with an account.
Worked example

Two translation needs

A software company must translate 3,000 pages of technical documentation into six languages each release, keeping formatting and using approved terms, and must adapt short marketing taglines for each market.

Use Translator document translation with a glossary (or a Custom Translator model) for the documentation, and an LLM translation flow with tone instructions, the glossary and human review for taglines. Using an LLM for all documentation would cost more and risk inconsistent terminology.

Check yourself

How is domain terminology kept consistent in large-scale translation?

Show answer

With glossaries or Custom Translator in Azure Translator.

Exam Tips

Remember for the exam

  • Large document batches with formatting: Translator document translation.
  • Domain terminology at scale: glossaries or Custom Translator.
  • Tone and cultural adaptation: LLM translation flows with review.