您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

文本翻译的请求限制Request limits for Translator Text

本文提供了文本翻译 API 的限制。This article provides throttling limits for the Translator Text API. 服务包括翻译、音译、句子长度检测、语言检测和备用翻译。Services include translation, transliteration, sentence length detection, language detection, and alternate translations.

每个请求的字符和数组限制Character and array limits per request

每个转换请求限制为5000个字符。Each Translate request is limited to 5,000 characters. 按字符收费,而不是按请求数收费。You're charged per character, not by the number of requests. 建议发送较短的请求。It's recommended to send shorter requests.

下表列出了每个文本翻译 API 操作的数组元素和字符限制。The following table lists array element and character limits for each operation of the Translator Text API.

OperationOperation 数组元素的最大大小Maximum Size of Array Element 数组元素的最大数目Maximum Number of Array Elements 最大请求大小(个字符)Maximum Request Size (characters)
TranslateTranslate 5,0005,000 100100 5,0005,000
TransliterateTransliterate 5,0005,000 1010 5,0005,000
DetectDetect 10,00010,000 100100 50,00050,000
BreakSentenceBreakSentence 10,00010,000 100100 50,00050,000
字典查找Dictionary Lookup 100100 1010 1,0001,000
字典示例Dictionary Examples 对于文本为100,对于翻译为100(200 total)100 for text and 100 for translation (200 total) 1010 2,0002,000

每小时的字符限制Character limits per hour

每小时的字符限制取决于文本翻译订阅层。Your character limit per hour is based on your Translator Text subscription tier.

每小时配额应平均消耗一小时。The hourly quota should be consumed evenly throughout the hour. 例如,每小时的 F0 层限制为2000000个字符,则字符的使用速度不应比大约每分钟大约33300个字符的滑动窗口(2000000个字符除以60分钟)。For example, at the F0 tier limit of 2 million characters per hour, characters should be consumed no faster than roughly 33,300 characters per minute sliding window (2 million characters divided by 60 minutes).

如果达到或超过这些限制,或在较短的时间内发送过多的配额,则可能会收到超出配额的响应。If you reach or surpass these limits, or send too large of a portion of the quota in a short period of time, you'll likely receive an out of quota response. 对于并发请求没有限制。There are no limits on concurrent requests.

Tier 字符限制Character limit
F0F0 每小时 200 万个字符2 million characters per hour
S1S1 每小时 4000 万个字符40 million characters per hour
S2/C2S2 / C2 每小时 4000 万个字符40 million characters per hour
S3/C3S3 / C3 每小时 1.2 亿个字符120 million characters per hour
S4/C4S4 / C4 每小时 2 亿个字符200 million characters per hour

多服务订阅的限制与 S1 层相同。Limits for multi-service subscriptions are the same as the S1 tier.

这些限制仅限于 Microsoft 标准翻译模型。These limits are restricted to Microsoft's standard translation models. 使用自定义转换器的自定义翻译模型的每秒限制为1800个字符。Custom translation models that use Custom Translator are limited to 1,800 characters per second.

延迟Latency

使用标准模型时,文本翻译 API 的最大延迟为15秒,使用自定义模型时为120秒。The Translator Text API has a maximum latency of 15 seconds using standard models and 120 seconds when using custom models. 通常, 100 字符内的文本响应会在150毫秒后返回到300毫秒。Typically, responses for text within 100 characters are returned in 150 milliseconds to 300 milliseconds. 自定义转换器模型对于持续的请求速率具有相似的延迟特征,在请求速率为间歇性时可能会有较高的延迟。The custom translator models have similar latency characteristics on sustained request rate and may have a higher latency when your request rate is intermittent. 响应时间将因请求和语言对的大小而异。Response times will vary based on the size of the request and language pair. 如果在该时间范围内未收到翻译或错误响应,请检查你的代码和你的网络连接,然后重试。If you don’t receive a translation or an error response within that timeframe, please check your code, your network connection and retry.

句子长度限制Sentence length limits

使用 BreakSentence 函数时,句子长度限制为 275 个字符。When using the BreakSentence function, sentence length is limited to 275 characters. 这些语言存在例外情况:There are exceptions for these languages:

语言Language 代码Code 字符限制Character limit
中文Chinese zhzh 132132
德语German dede 290290
意大利语Italian itit 280280
日语Japanese jaja 150150
葡萄牙语Portuguese ptpt 290290
西班牙语Spanish eses 280280
意大利语Italian itit 280280
泰语Thai thth 258258

备注

此限制不适用于翻译。This limit doesn't apply to translations.

后续步骤Next steps