public class TranslateDocumentOptions
extends com.ibm.cloud.sdk.core.service.model.GenericModel
Modifier and Type | Class and Description |
---|---|
static class |
TranslateDocumentOptions.Builder
Builder.
|
Modifier and Type | Method and Description |
---|---|
String |
documentId()
Gets the documentId.
|
InputStream |
file()
Gets the file.
|
String |
fileContentType()
Gets the fileContentType.
|
String |
filename()
Gets the filename.
|
String |
modelId()
Gets the modelId.
|
TranslateDocumentOptions.Builder |
newBuilder()
New builder.
|
String |
source()
Gets the source.
|
String |
target()
Gets the target.
|
public TranslateDocumentOptions.Builder newBuilder()
public InputStream file()
The contents of the source file to translate. The maximum file size for document translation is * **2 MB** for service instances on the Lite plan * **20 MB** for service instances on the Standard plan * **50 MB** for service instances on the Advanced plan * **150 MB** for service instances on the Premium plan
You can specify the format of the file to be translated in one of two ways: * By specifying the appropriate file extension for the format. * By specifying the content type (MIME type) of the format as the `type` of the `file` parameter.
In some cases, especially for subtitle file formats, you must use either the file extension or the content type.
For more information about all supported file formats, their file extensions and content types, and how and when to specify the file extension or content type, see [Supported file formats](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats).
public String filename()
The filename for file.
public String fileContentType()
The content type of file. Values for this parameter can be obtained from the HttpMediaType class.
public String modelId()
The model to use for translation. For example, `en-de` selects the IBM-provided base model for English-to-German translation. A model ID overrides the `source` and `target` parameters and is required if you use a custom model. If no model ID is specified, you must specify at least a target language.
public String source()
Language code that specifies the language of the source document. If omitted, the service derives the source language from the input text. The input must contain sufficient text for the service to identify the language reliably.
public String target()
Language code that specifies the target language for translation. Required if model ID is not specified.
public String documentId()
To use a previously submitted document as the source for a new translation, enter the `document_id` of the document.
Copyright © 2024 IBM Cloud. All rights reserved.