/AWS1/IF_XL8=>STARTTEXTTRANSLATIONJOB()¶
About StartTextTranslationJob¶
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.
Method Signature¶
METHODS /AWS1/IF_XL8~STARTTEXTTRANSLATIONJOB
IMPORTING
!IV_JOBNAME TYPE /AWS1/XL8JOBNAME OPTIONAL
!IO_INPUTDATACONFIG TYPE REF TO /AWS1/CL_XL8INPUTDATACONFIG OPTIONAL
!IO_OUTPUTDATACONFIG TYPE REF TO /AWS1/CL_XL8OUTPUTDATACONFIG OPTIONAL
!IV_DATAACCESSROLEARN TYPE /AWS1/XL8IAMROLEARN OPTIONAL
!IV_SOURCELANGUAGECODE TYPE /AWS1/XL8LANGUAGECODESTRING OPTIONAL
!IT_TARGETLANGUAGECODES TYPE /AWS1/CL_XL8TGTLANGUAGECODES00=>TT_TARGETLANGUAGECODESTRLIST OPTIONAL
!IT_TERMINOLOGYNAMES TYPE /AWS1/CL_XL8RESOURCENAMELIST_W=>TT_RESOURCENAMELIST OPTIONAL
!IT_PARALLELDATANAMES TYPE /AWS1/CL_XL8RESOURCENAMELIST_W=>TT_RESOURCENAMELIST OPTIONAL
!IV_CLIENTTOKEN TYPE /AWS1/XL8CLIENTTOKENSTRING OPTIONAL
!IO_SETTINGS TYPE REF TO /AWS1/CL_XL8XLATIONSETTINGS OPTIONAL
RETURNING
VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_xl8strttextxlatjobrsp
RAISING
/AWS1/CX_XL8INTERNALSERVEREX
/AWS1/CX_XL8INVPARAMVALUEEX
/AWS1/CX_XL8INVALIDREQUESTEX
/AWS1/CX_XL8RESOURCENOTFOUNDEX
/AWS1/CX_XL8TOOMANYREQUESTSEX
/AWS1/CX_XL8UNSUPPEDLANGUAGE00
/AWS1/CX_XL8CLIENTEXC
/AWS1/CX_XL8SERVEREXC
/AWS1/CX_RT_TECHNICAL_GENERIC
/AWS1/CX_RT_SERVICE_GENERIC.
IMPORTING¶
Required arguments:¶
io_inputdataconfig TYPE REF TO /AWS1/CL_XL8INPUTDATACONFIG /AWS1/CL_XL8INPUTDATACONFIG¶
Specifies the format and location of the input documents for the translation job.
io_outputdataconfig TYPE REF TO /AWS1/CL_XL8OUTPUTDATACONFIG /AWS1/CL_XL8OUTPUTDATACONFIG¶
Specifies the S3 folder to which your job output will be saved.
iv_dataaccessrolearn TYPE /AWS1/XL8IAMROLEARN /AWS1/XL8IAMROLEARN¶
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 .
iv_sourcelanguagecode TYPE /AWS1/XL8LANGUAGECODESTRING /AWS1/XL8LANGUAGECODESTRING¶
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.
it_targetlanguagecodes TYPE /AWS1/CL_XL8TGTLANGUAGECODES00=>TT_TARGETLANGUAGECODESTRLIST TT_TARGETLANGUAGECODESTRLIST¶
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.
iv_clienttoken TYPE /AWS1/XL8CLIENTTOKENSTRING /AWS1/XL8CLIENTTOKENSTRING¶
A unique identifier for the request. This token is generated for you when using the Amazon Translate SDK.
Optional arguments:¶
iv_jobname TYPE /AWS1/XL8JOBNAME /AWS1/XL8JOBNAME¶
The name of the batch translation job to be performed.
it_terminologynames TYPE /AWS1/CL_XL8RESOURCENAMELIST_W=>TT_RESOURCENAMELIST TT_RESOURCENAMELIST¶
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.
it_paralleldatanames TYPE /AWS1/CL_XL8RESOURCENAMELIST_W=>TT_RESOURCENAMELIST TT_RESOURCENAMELIST¶
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.
io_settings TYPE REF TO /AWS1/CL_XL8XLATIONSETTINGS /AWS1/CL_XL8XLATIONSETTINGS¶
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.
RETURNING¶
oo_output TYPE REF TO /aws1/cl_xl8strttextxlatjobrsp /AWS1/CL_XL8STRTTEXTXLATJOBRSP¶
Domain /AWS1/RT_ACCOUNT_ID Primitive Type NUMC
Examples¶
Syntax Example¶
This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.
DATA(lo_result) = lo_client->starttexttranslationjob(
io_inputdataconfig = new /aws1/cl_xl8inputdataconfig(
iv_contenttype = |string|
iv_s3uri = |string|
)
io_outputdataconfig = new /aws1/cl_xl8outputdataconfig(
io_encryptionkey = new /aws1/cl_xl8encryptionkey(
iv_id = |string|
iv_type = |string|
)
iv_s3uri = |string|
)
io_settings = new /aws1/cl_xl8xlationsettings(
iv_brevity = |string|
iv_formality = |string|
iv_profanity = |string|
)
it_paralleldatanames = VALUE /aws1/cl_xl8resourcenamelist_w=>tt_resourcenamelist(
( new /aws1/cl_xl8resourcenamelist_w( |string| ) )
)
it_targetlanguagecodes = VALUE /aws1/cl_xl8tgtlanguagecodes00=>tt_targetlanguagecodestrlist(
( new /aws1/cl_xl8tgtlanguagecodes00( |string| ) )
)
it_terminologynames = VALUE /aws1/cl_xl8resourcenamelist_w=>tt_resourcenamelist(
( new /aws1/cl_xl8resourcenamelist_w( |string| ) )
)
iv_clienttoken = |string|
iv_dataaccessrolearn = |string|
iv_jobname = |string|
iv_sourcelanguagecode = |string|
).
This is an example of reading all possible response values
lo_result = lo_result.
IF lo_result IS NOT INITIAL.
lv_jobid = lo_result->get_jobid( ).
lv_jobstatus = lo_result->get_jobstatus( ).
ENDIF.