Translating text and documents with Azure Translator
5 minutes
5 Questions
Azure Translator is a cloud-based neural machine translation service that enables developers to integrate multilingual text and document translation capabilities into applications. As part of Azure Cognitive Services, it supports over 100 languages and dialects for real-time translation scenarios.
…Azure Translator is a cloud-based neural machine translation service that enables developers to integrate multilingual text and document translation capabilities into applications. As part of Azure Cognitive Services, it supports over 100 languages and dialects for real-time translation scenarios.
For text translation, developers can use the REST API to send requests containing source text and receive translated content. The API supports features like language detection, transliteration (converting text between scripts), and dictionary lookups for alternative translations. You can translate single strings or batch multiple texts in a single request for efficiency.
Document translation extends these capabilities to entire files while preserving the original formatting. Supported formats include PDF, Word documents, PowerPoint presentations, Excel spreadsheets, and plain text files. The service processes documents asynchronously through Azure Blob Storage, where you upload source documents and retrieve translated versions from a target container.
Key features include custom translation using Custom Translator, which allows training models with domain-specific terminology and phrases. This proves valuable for industries with specialized vocabulary like legal, medical, or technical fields. You create training datasets with parallel documents and train custom models that integrate seamlessly with the standard translation endpoints.
Authentication requires an Azure subscription and a Translator resource. You obtain API keys and endpoint URLs from the Azure portal to authenticate requests. Regional endpoints are available globally for low-latency access.
The pricing model offers a free tier for evaluation and pay-as-you-go options based on character count for text translation or page count for document translation.
Practical implementations include building multilingual chatbots, localizing application content, enabling cross-language communication in collaboration tools, and processing international business documents. The service integrates well with other Azure services like Azure Functions for serverless architectures and Logic Apps for workflow automation.
Translating Text and Documents with Azure Translator
Why is This Important?
Azure Translator is a critical component of the AI-102 exam because it enables organizations to break down language barriers in their applications. In today's globalized world, businesses need to communicate across multiple languages, and understanding how to implement translation solutions is essential for any Azure AI Engineer.
What is Azure Translator?
Azure Translator is a cloud-based machine translation service that is part of Azure Cognitive Services. It provides:
• Text Translation API - Translates text strings between 100+ languages • Document Translation - Translates entire documents while preserving formatting • Custom Translator - Allows you to build customized translation models for domain-specific terminology • Transliteration - Converts text from one script to another within the same language • Language Detection - Automatically identifies the source language • Dictionary Lookup - Provides alternative translations and usage examples
How Does It Work?
Text Translation: 1. Create a Translator resource in Azure portal 2. Obtain your subscription key and endpoint 3. Send HTTP POST requests to the translation endpoint with your text 4. Specify source language (optional - can be auto-detected) and target language(s) 5. Receive translated text in JSON format
Document Translation: 1. Upload source documents to Azure Blob Storage 2. Create a target container for translated documents 3. Submit a translation request specifying source URL, target URL, and target language 4. The service translates documents asynchronously while maintaining original formatting 5. Supported formats include PDF, DOCX, PPTX, XLSX, HTML, and more
Key API Parameters: • from - Source language code (optional) • to - Target language code(s) - can specify multiple • textType - Specify 'plain' or 'html' • category - Use custom translation models • profanityAction - Handle profanity (NoAction, Marked, Deleted)
Exam Tips: Answering Questions on Azure Translator
1. Know the endpoints: Text translation uses api.cognitive.microsofttranslator.com while Document Translation uses a different endpoint structure with your resource name
2. Understand authentication: You need either a subscription key (Ocp-Apim-Subscription-Key header) or Azure Active Directory token
3. Remember regional requirements: For multi-service resources, you must include the region in your requests using the Ocp-Apim-Subscription-Region header
4. Character limits: Each text translation request is limited to 10,000 characters, and you can translate to multiple languages in a single request
5. Document Translation is asynchronous: Unlike text translation, document translation requires polling to check completion status
6. Custom Translator scenarios: When questions mention industry-specific terminology or domain-specific translations, Custom Translator is the appropriate solution
7. SAS tokens: Document Translation requires Shared Access Signature (SAS) tokens with appropriate permissions for blob storage containers
8. Language codes: Be familiar with common language codes (en, fr, de, es, zh-Hans, ja) and know that the API uses BCP-47 language tags
9. Transliteration vs Translation: Transliteration changes the script (e.g., Japanese Hiragana to Romaji) while translation changes the language
10. Billing: Translator is billed per character translated, so questions about cost optimization may involve batching requests efficiently