Επεξεργασία

Document Translation SDK

Document Translation is a cloud-based REST API feature of the Azure AI Translator service. The Document Translation API enables quick and accurate source-to-target whole document translations, asynchronously, in supported languages and various file formats. The Document Translation software development kit (SDK) is a set of libraries and tools that enable you to easily integrate Document Translation REST API capabilities into your applications.

Supported languages

Document Translation SDK supports the following programming languages:

Language → SDK version Package Client library Supported API version
.NET/C# → 1.0.0 NuGet Azure SDK for .NET Document Translation v1.1
Python → 1.0.0 PyPi Azure SDK for Python Document Translation v1.1

Changelog and release history

This section provides a version-based description of Document Translation feature and capability releases, changes, updates, and enhancements.

Version 1.0.0 (GA)
2022-06-07

Changelog/Release History
README
Samples

Use Document Translation SDK in your applications

The Document Translation SDK enables the use and management of the Translation service in your application. The SDK builds on the underlying Document Translation REST APIs for use within your programming language paradigm. Choose your preferred programming language:

1. Install the SDK client library

dotnet add package Azure.AI.Translation.Document --version 1.0.0
Install-Package Azure.AI.Translation.Document -Version 1.0.0

2. Import the SDK client library into your application

using System;
using Azure.Core;
using Azure.AI.Translation.Document;

3. Authenticate the client

Create an instance of the DocumentTranslationClient object to interact with the Document Translation SDK, and then call methods on that client object to interact with the service. The DocumentTranslationClient is the primary interface for using the Document Translation client library. It provides both synchronous and asynchronous methods to perform operations.

private static readonly string endpoint = "<your-custom-endpoint>";
private static readonly string key = "<your-key>";

DocumentTranslationClient client = new DocumentTranslationClient(new Uri(endpoint), new AzureKeyCredential(key));

4. Build your application

The Document Translation interface requires the following input:

  1. Upload your files to an Azure Blob Storage source container (sourceUri).
  2. Provide a target container where the translated documents can be written (targetUri).
  3. Include the target language code (targetLanguage).

Uri sourceUri = new Uri("<your-source container-url");
Uri targetUri = new Uri("<your-target-container-url>");
string targetLanguage = "<target-language-code>";

DocumentTranslationInput input = new DocumentTranslationInput(sourceUri, targetUri, targetLanguage)

Help options

The Microsoft Q&A and Stack Overflow forums are available for the developer community to ask and answer questions about Azure Text Translation and other services. Microsoft monitors the forums and replies to questions that the community has yet to answer.

Tip

To make sure that we see your Microsoft Q&A question, tag it with microsoft-translator. To make sure that we see your Stack Overflow question, tag it with Azure AI Translator.

Next steps