public class AddCorpusOptions
extends com.ibm.cloud.sdk.core.service.model.GenericModel
Modifier and Type | Class and Description |
---|---|
static class |
AddCorpusOptions.Builder
Builder.
|
Modifier and Type | Field and Description |
---|---|
protected java.lang.Boolean |
allowOverwrite |
protected java.io.InputStream |
corpusFile |
protected java.lang.String |
corpusName |
protected java.lang.String |
customizationId |
Modifier | Constructor and Description |
---|---|
protected |
AddCorpusOptions(AddCorpusOptions.Builder builder) |
Modifier and Type | Method and Description |
---|---|
java.lang.Boolean |
allowOverwrite()
Gets the allowOverwrite.
|
java.io.InputStream |
corpusFile()
Gets the corpusFile.
|
java.lang.String |
corpusName()
Gets the corpusName.
|
java.lang.String |
customizationId()
Gets the customizationId.
|
AddCorpusOptions.Builder |
newBuilder()
New builder.
|
protected java.lang.String customizationId
protected java.lang.String corpusName
protected java.io.InputStream corpusFile
protected java.lang.Boolean allowOverwrite
protected AddCorpusOptions(AddCorpusOptions.Builder builder)
public AddCorpusOptions.Builder newBuilder()
public java.lang.String customizationId()
The customization ID (GUID) of the custom language model that is to be used for the request. You must make the request with credentials for the instance of the service that owns the custom model.
public java.lang.String corpusName()
The name of the new corpus for the custom language model. Use a localized name that matches the language of the custom model and reflects the contents of the corpus. * Include a maximum of 128 characters in the name. * Do not use characters that need to be URL-encoded. For example, do not use spaces, slashes, backslashes, colons, ampersands, double quotes, plus signs, equals signs, questions marks, and so on in the name. (The service does not prevent the use of these characters. But because they must be URL-encoded wherever used, their use is strongly discouraged.) * Do not use the name of an existing corpus or grammar that is already defined for the custom model. * Do not use the name `user`, which is reserved by the service to denote custom words that are added or modified by the user. * Do not use the name `base_lm` or `default_lm`. Both names are reserved for future use by the service.
public java.io.InputStream corpusFile()
A plain text file that contains the training data for the corpus. Encode the file in UTF-8 if it contains non-ASCII characters; the service assumes UTF-8 encoding if it encounters non-ASCII characters.
Make sure that you know the character encoding of the file. You must use that encoding when working with the words in the custom language model. For more information, see [Character encoding](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-corporaWords#charEncoding).
With the `curl` command, use the `--data-binary` option to upload the file for the request.
public java.lang.Boolean allowOverwrite()
If `true`, the specified corpus overwrites an existing corpus with the same name. If `false`, the request fails if a corpus with the same name already exists. The parameter has no effect if a corpus with the same name does not already exist.