start_text_translation_job
async
¶
start_text_translation_job(
input_data_config: InputDataConfig,
output_data_config: OutputDataConfig,
data_access_role_arn: IamRoleArn,
source_language_code: LanguageCodeString,
target_language_codes: TargetLanguageCodeStringList,
client_token: ClientTokenString,
*,
config_overrides: Optional[AsyncTranslateClientConfig] = None,
job_name: Optional[JobName] = None,
terminology_names: Optional[ResourceNameList] = None,
parallel_data_names: Optional[ResourceNameList] = None,
settings: Optional[TranslationSettings] = None,
) -> StartTextTranslationJobResponse
Starts an asynchronous batch translation job. Use batch translation jobs to translate large volumes of text across multiple documents at once. For batch translation, you can input documents with different source languages (specify auto as the source language). You can specify one or more target languages. Batch translation translates each input document into each of the target languages. For more information, see Asynchronous batch processing.
Batch translation jobs can be described with the DescribeTextTranslationJob operation, listed with the ListTextTranslationJobs operation, and stopped with the StopTextTranslationJob operation.
Parameters:
-
job_name(Optional[JobName], default:None) –The name of the batch translation job to be performed.
-
input_data_config(InputDataConfig) –Specifies the format and location of the input documents for the translation job.
-
output_data_config(OutputDataConfig) –Specifies the S3 folder to which your job output will be saved.
-
data_access_role_arn(IamRoleArn) –The Amazon Resource Name (ARN) of an AWS Identity Access and Management (IAM) role that grants Amazon Translate read access to your input data. For more information, see Identity and access management .
-
source_language_code(LanguageCodeString) –The language code of the input language. Specify the language if all input documents share the same language. If you don't know the language of the source files, or your input documents contains different source languages, select
auto. Amazon Translate auto detects the source language for each input document. For a list of supported language codes, see Supported languages. -
target_language_codes(TargetLanguageCodeStringList) –The target languages of the translation job. Enter up to 10 language codes. Each input file is translated into each target language.
Each language code is 2 or 5 characters long. For a list of language codes, see Supported languages.
-
terminology_names(Optional[ResourceNameList], default:None) –The name of a custom terminology resource to add to the translation job. This resource lists examples source terms and the desired translation for each term.
This parameter accepts only one custom terminology resource.
If you specify multiple target languages for the job, translate uses the designated terminology for each requested target language that has an entry for the source term in the terminology file.
For a list of available custom terminology resources, use the ListTerminologies operation.
For more information, see Custom terminology.
-
parallel_data_names(Optional[ResourceNameList], default:None) –The name of a parallel data resource to add to the translation job. This resource consists of examples that show how you want segments of text to be translated. If you specify multiple target languages for the job, the parallel data file must include translations for all the target languages.
When you add parallel data to a translation job, you create an Active Custom Translation job.
This parameter accepts only one parallel data resource.
Active Custom Translation jobs are priced at a higher rate than other jobs that don't use parallel data. For more information, see Amazon Translate pricing.
For a list of available parallel data resources, use the ListParallelData operation.
For more information, see Customizing your translations with parallel data.
-
client_token(ClientTokenString) –A unique identifier for the request. This token is generated for you when using the Amazon Translate SDK.
-
settings(Optional[TranslationSettings], default:None) –Settings to configure your translation output. You can configure the following options:
-
Brevity: not supported.
-
Formality: sets the formality level of the output text.
-
Profanity: masks profane words and phrases in your translation output.
-
Raises:
-
InternalServerException–An internal server error occurred. Retry your request.
-
InvalidParameterValueException–The value of the parameter is not valid. Review the value of the parameter you are using to correct it, and then retry your operation.
-
InvalidRequestException–The request that you made is not valid. Check your request to determine why it's not valid and then retry the request.
-
ResourceNotFoundException–The resource you are looking for has not been found. Review the resource you're looking for and see if a different resource will accomplish your needs before retrying the revised request.
-
TooManyRequestsException–You have made too many requests within a short period of time. Wait for a short time and then try your request again.
-
UnsupportedLanguagePairException–Amazon Translate does not support translation from the language of the source text into the requested target language. For more information, see Supported languages.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_translate/_services/async_translate.py
983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 | |