[使用AWS Translation API时出现ThrottlingException

问题描述 投票:0回答:1

我正在运行此代码进行翻译

translate = boto3.client(service_name='translate',
    aws_access_key_id="secret",
    aws_secret_access_key="secret",
    region_name='eu-central-1',
    use_ssl=True)

translate.translate_text(Text=data,SourceLanguageCode="de",TargetLanguageCode="en").get("TranslatedText")

代码在大多数测试中都能正常运行,但突然抛出以下错误:

An error occurred (ThrottlingException) when calling the TranslateText operation (reached max retries: 4): Rate exceeded 

如何处理此异常?

python amazon-web-services amazon-ec2 boto3 boto
1个回答
0
投票

此链接提供了节流异常的答案https://docs.aws.amazon.com/translate/latest/dg/what-is-limits.html#limits-throttling

该服务根据交通模式扩大车队。我想知道您达到了什么节流极限。

© www.soinside.com 2019 - 2024. All rights reserved.