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
1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 | |