将 Translator V2 迁移到 V3Translator V2 to V3 Migration

备注

V2 已于 2018 年 4 月 30 日弃用。V2 was deprecated on April 30, 2018. 请将应用程序迁移到 V3,以便利用 V3 中专门提供的新功能。Please migrate your applications to V3 in order to take advantage of new functionality available exclusively in V3.

Microsoft Translator Hub 将于 2019 年 5 月 17 日停用。The Microsoft Translator Hub will be retired on May 17, 2019. 查看重要迁移信息和日期View important migration information and dates.

Microsoft Translator 团队已发布 Translator 版本 3 (V3)。The Microsoft Translator team has released Version 3 (V3) of the Translator. 此版本包括新的功能、弃用了一些方法,并提供与 Microsoft Translator 服务相互发送和接收数据时所用的新格式。This release includes new features, deprecated methods and a new format for sending to, and receiving data from the Microsoft Translator Service. 本文档提供有关将应用程序更改为使用 V3 的信息。This document provides information for changing applications to use V3.

本文档末尾包含有用的链接,便于你了解详细信息。The end of this document contains helpful links for you to learn more.

功能摘要Summary of features

  • 无跟踪 - 在 V3 中,“无跟踪”将应用到 Azure 门户中的所有定价层。No Trace - In V3 No-Trace applies to all pricing tiers in the Azure portal. 此功能意味着,Microsoft 不会保存提交到 V3 API 的任何文本。This feature means that no text submitted to the V3 API, will be saved by Microsoft.
  • JSON - XML 将由 JSON 取代。JSON - XML is replaced by JSON. 发送到服务的所有数据以及从服务接收的所有数据将采用 JSON 格式。All data sent to the service and received from the service is in JSON format.
  • 单个请求中的多个目标语言 - Translate 方法接受单个请求中的多个翻译“目标”语言。Multiple target languages in a single request - The Translate method accepts multiple 'to' languages for translation in a single request. 例如,单个请求可以是“从”英语翻译“到”德语、西班牙语和日语,或任何其他语言组。For example, a single request can be 'from' English and 'to' German, Spanish and Japanese, or any other group of languages.
  • 双语字典 - 已将一个双语字典方法添加到 API。Bilingual dictionary - A bilingual dictionary method has been added to the API. 此方法包括“查找”和“示例”。This method includes 'lookup' and 'examples'.
  • 音译 - 已将一个 transliterate 方法添加到 API。Transliterate - A transliterate method has been added to the API. 此方法会将一个脚本(例如阿拉伯语)This method will convert words and sentences in one script (E.g. 中的单词和句子转换成另一个脚本(例如Arabic) into another script (E.g. 拉丁语)。Latin).
  • 语言 - 新的“languages”方法会提供 JSON 格式的语言信息,以便与“translate”、“dictionary”和“transliterate”方法结合使用。Languages - A new 'languages' method delivers language information, in JSON format, for use with the 'translate', 'dictionary', and 'transliterate' methods.
  • 新的翻译功能 - 已将新功能添加到“translate”方法,以支持 V2 API 中作为单独方法提供的某些功能。New to Translate - New capabilities have been added to the 'translate' method to support some of the features that were in the V2 API as separate methods. 示例包括 TranslateArray。An example is TranslateArray.
  • 讲述方法 - Microsoft Translator 不再支持文本转语音功能。Speak method - Text to speech functionality is no longer supported in the Microsoft Translator. Microsoft 语音服务中提供了文本转语音功能。Text to speech functionality is available in Microsoft Speech Service.

以下 V2 和 V3 方法列表指明了能够提供 V2 随附的功能的 V3 方法和 API。The following list of V2 and V3 methods identifies the V3 methods and APIs that will provide the functionality that came with V2.

V2 API 方法V2 API Method V3 API 兼容性V3 API Compatibility
Translate TranslateTranslate
TranslateArray TranslateTranslate
GetLanguageNames 语言Languages
GetLanguagesForTranslate 语言Languages
GetLanguagesForSpeak Microsoft 语音服务Microsoft Speech Service
Speak Microsoft 语音服务Microsoft Speech Service
Detect DetectDetect
DetectArray DetectDetect
AddTranslation 不再支持的功能Feature is no longer supported
AddTranslationArray 不再支持的功能Feature is no longer supported
BreakSentences BreakSentenceBreakSentence
GetTranslations 不再支持的功能Feature is no longer supported
GetTranslationsArray 不再支持的功能Feature is no longer supported

改为 JSON 格式Move to JSON format

Microsoft Translator 翻译 V2 接受 XML 格式的数据,并以此格式返回数据。Microsoft Translator Translation V2 accepted and returned data in XML format. 在 V3 中,使用 API 发送和接收的所有数据采用 JSON 格式。In V3 all data sent and received using the API is in JSON format. 在 V3 中,不再接受或返回 XML 数据。XML will no longer be accepted or returned in V3.

此项更改会影响针对 V2 文本翻译 API 编写的应用程序的多个方面。This change will affect several aspects of an application written for the V2 Text Translation API. 例如:语言 API 返回文本翻译、音译和两个字典方法的语言信息。As an example: The Languages API returns language information for text translation, transliteration, and the two dictionary methods. 可以通过一次调用请求所有方法的所有语言信息,或单独请求这些方法的信息。You can request all language information for all methods in one call or request them individually.

languages 方法不需要身份验证;单击以下链接可以看到 V3 的 JSON 格式的所有语言信息:The languages method does not require authentication; by clicking on the following link you can see all the language information for V3 in JSON:

https://api.translator.azure.cn/languages?api-version=3.0&scope=translation,dictionary,transliterationhttps://api.translator.azure.cn/languages?api-version=3.0&scope=translation,dictionary,transliteration

身份验证密钥Authentication Key

V3 接受对 V2 所用的身份验证密钥。The authentication key you are using for V2 will be accepted for V3. 不需要获取新订阅。You will not need to get a new subscription. 在为期一年的迁移时间段内,可以在应用中混合使用 V2 和 V3,因此可以更轻松地发布新版本,同时逐步地从 V2-XML 迁移到 V3-JSON。You will be able to mix V2 and V3 in your apps during the yearlong migration period, making it easier for you to release new versions while you are still migrating from V2-XML to V3-JSON.

定价模型Pricing Model

Microsoft Translator V3 的定价方式与 V2 相同:按字符(包括空格)计费。Microsoft Translator V3 is priced in the same way V2 was priced; per character, including spaces. 在哪些字符应该计费这一方面,V3 中的新功能做了一些改变。The new features in V3 make some changes in what characters are counted for billing.

V3 方法V3 Method 应计费的字符Characters Counted for Billing
Languages 未提交任何字符:不计算字符数,免费。No characters submitted, none counted, no charge.
Translate 根据提交翻译的字符数,以及字符要翻译成的语言数来统计费用。Count is based on how many characters are submitted for translation, and how many languages the characters are translated into. 如果提交了 50 个字符并 5 请求翻译成 5 种语言,则费用是 50x5。50 characters submitted, and 5 languages requested will be 50x5.
Transliterate 根据提交音译的字符数统计费用。Number of characters submitted for transliteration are counted.
Dictionary lookup & example 根据提交请求字典查找和示例的字符数统计费用。Number of characters submitted for Dictionary lookup and examples are counted.
BreakSentence 免费。No Charge.
Detect 免费。No Charge.

V3 终结点V3 End Points

全球Global

  • api.translator.azure.cnapi.translator.azure.cn

V3 API 文本翻译方法V3 API text translations methods

Languages

Translate

Transliterate

BreakSentence

Detect

Dictionary/lookup

Dictionary/example

兼容性和自定义Compatibility and customization

备注

Microsoft Translator Hub 将于 2019 年 5 月 17 日停用。The Microsoft Translator Hub will be retired on May 17, 2019. 查看重要迁移信息和日期View important migration information and dates.

Microsoft Translator V3 默认使用神经机器翻译。Microsoft Translator V3 uses neural machine translation by default. 因此,它不能与 Microsoft Translator Hub 一起使用。As such, it cannot be used with the Microsoft Translator Hub. Translator Hub 仅支持传统的统计机器翻译。The Translator Hub only supports legacy statistical machine translation. 现在,可以使用 Custom Translator 对神经翻译进行自定义。Customization for neural translation is now available using the Custom Translator.

使用 V3 文本 API 的神经翻译不支持使用标准类别(SMT、语音、技术、generalnn)。Neural translation with the V3 text API does not support the use of standard categories (SMT, speech, tech, generalnn).

版本Version 终结点Endpoint GDPR 处理器符合性GDPR Processor Compliance 使用 Translator HubUse Translator Hub 使用自定义翻译器(预览版)Use Custom Translator (Preview)
Translator 版本 2Translator Version 2 api.translator.azure.cnapi.translator.azure.cn No Yes No
Translator 版本 3Translator Version 3 api.translator.azure.cnapi.translator.azure.cn Yes No Yes

Translator 版本 3Translator Version 3

  • 已正式发布且完全受支持。Is generally available and fully supported.
  • 作为处理器符合 GDPR,并满足所有 ISO 20001、20018 以及 SOC 3 认证要求。Is GDPR compliant as a processor and satisfies all ISO 20001 and 20018 as well as SOC 3 certification requirements.
  • 可用于调用已使用自定义翻译器(预览版,新的 Translator NMT 自定义功能)自定义的神经网络翻译系统。Allows you to invoke the neural network translation systems you have customized with Custom Translator (Preview), the new Translator NMT customization feature.
  • 不提供对使用 Microsoft Translator Hub 创建的自定义翻译系统的访问权限。Does not provide access to custom translation systems created using the Microsoft Translator Hub.

如果正在使用 api.translator.azure.cn 终结点,则使用的是 Translator 版本 3。You are using Version 3 of the Translator if you are using the api.translator.azure.cn endpoint.

Translator 版本 2Translator Version 2

  • 不满足所有 ISO 20001、20018 和 SOC 3 认证要求。Does not satisfy all ISO 20001,20018 and SOC 3 certification requirements.
  • 不可用于调用已使用 Translator 自定义功能自定义的神经网络翻译系统。Does not allow you to invoke the neural network translation systems you have customized with the Translator customization feature.
  • 提供对使用 Microsoft Translator Hub 创建的自定义翻译系统的访问权限。Provides access to custom translation systems created using the Microsoft Translator Hub.
  • 如果正在使用 api.microsofttranslator.com 终结点,则使用的是 Translator 版本 2。You are using Version 2 of the Translator if you are using the api.microsofttranslator.com endpoint.

任何版本的 Translator 都不会创建翻译的记录。No version of the Translator creates a record of your translations. 永远不会与任何人共享你的翻译。Your translations are never shared with anyone. 有关详细信息,请参阅 Translator 无跟踪网页。More information on the Translator No-Trace webpage.

后续步骤Next steps