Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
HTTP request
POST https://{TRANSLATION_GDC_ENDPOINT}/v3/{parent}:batchTranslateDocument
Path parameters
Parameters | |
---|---|
parent |
Required. Location to make a call. Format: The Only glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "sourceLanguageCode": string, "targetLanguageCodes": [ string ], "inputConfigs": [ { object ( |
Fields | |
---|---|
sourceLanguageCode |
Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Supported languages. |
targetLanguageCodes[] |
Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs[] |
Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig |
Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
glossaries |
Optional. Glossaries to be applied. It's keyed by target language code. |
formatConversions |
Optional. The file format conversion map that is applied to all input files. The map key is the original mimeType. The map value is the target mimeType of translated documents. Supported file format conversion includes: - If nothing specified, output files will be in the same format as the original file. |
customizedAttribution |
Optional. This flag is to support user customized attribution. If not provided, the default is |
enableShadowRemovalNativePdf |
Optional. If true, use the text removal server to remove the shadow text on background image for native pdf translation. Shadow removal feature can only be enabled when |
enableRotationCorrection |
Optional. If true, enable auto rotation correction in DVS. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
BatchDocumentInputConfig
Input configuration for locations.batchTranslateDocument request.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field source . Specify the input. source can be only one of the following: |
|
s3_source |
S3 bucket location for the source input. This can be a single file or a wildcard. File mime type is determined based on extension. Supported mime type includes:
The max file size to support for |
BatchDocumentOutputConfig
Output configuration for locations.batchTranslateDocument request.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field destination . The destination of output. The destination directory provided must exist and be empty. destination can be only one of the following: |
|
s3_destination |
S3 bucket destination for output content. For every single input document, we generate at most 2 * n output files. (n is the number of target language codes in the
|