public class TrainLanguageModelOptions
extends com.ibm.cloud.sdk.core.service.model.GenericModel
Modifier and Type | Class and Description |
---|---|
static class |
TrainLanguageModelOptions.Builder
Builder.
|
static interface |
TrainLanguageModelOptions.WordTypeToAdd
_For custom models that are based on previous-generation models_, the type of words from the
custom language model's words resource on which to train the model: * `all` (the default)
trains the model on all new words, regardless of whether they were extracted from corpora or
grammars or were added or modified by the user.
|
Modifier and Type | Method and Description |
---|---|
String |
customizationId()
Gets the customizationId.
|
Double |
customizationWeight()
Gets the customizationWeight.
|
Boolean |
force()
Gets the force.
|
TrainLanguageModelOptions.Builder |
newBuilder()
New builder.
|
Boolean |
strict()
Gets the strict.
|
String |
wordTypeToAdd()
Gets the wordTypeToAdd.
|
public TrainLanguageModelOptions.Builder newBuilder()
public 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 String wordTypeToAdd()
_For custom models that are based on previous-generation models_, the type of words from the custom language model's words resource on which to train the model: * `all` (the default) trains the model on all new words, regardless of whether they were extracted from corpora or grammars or were added or modified by the user. * `user` trains the model only on custom words that were added or modified by the user directly. The model is not trained on new words extracted from corpora or grammars.
_For custom models that are based on next-generation models_, the service ignores the parameter. The words resource contains only custom words that the user adds or modifies directly, so the parameter is unnecessary.
public Double customizationWeight()
Specifies a customization weight for the custom language model. The customization weight tells the service how much weight to give to words from the custom language model compared to those from the base model for speech recognition. Specify a value between 0.0 and 1.0. The default value is: * 0.3 for previous-generation models * 0.2 for most next-generation models * 0.1 for next-generation English and Japanese models
The default value yields the best performance in general. Assign a higher value if your audio makes frequent use of OOV words from the custom model. Use caution when setting the weight: a higher value can improve the accuracy of phrases from the custom model's domain, but it can negatively affect performance on non-domain phrases.
The value that you assign is used for all recognition requests that use the model. You can override it for any recognition request by specifying a customization weight for that request.
See [Using customization weight](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-languageUse#weight).
public Boolean strict()
If `false`, allows training of the custom language model to proceed as long as the model contains at least one valid resource. The method returns an array of `TrainingWarning` objects that lists any invalid resources. By default (`true`), training of a custom language model fails (status code 400) if the model contains one or more invalid resources (corpus files, grammar files, or custom words).
public Boolean force()
If `true`, forces the training of the custom language model regardless of whether it contains any changes (is in the `ready` or `available` state). By default (`false`), the model must be in the `ready` state to be trained. You can use the parameter to train and thus upgrade a custom model that is based on an improved next-generation model. *The parameter is available only for IBM Cloud, not for IBM Cloud Pak for Data.*
See [Upgrading a custom language model based on an improved next-generation model](https://cloud.ibm.com/docs/speech-to-text?topic=speech-to-text-custom-upgrade#custom-upgrade-language-ng).
Copyright © 2024 IBM Cloud. All rights reserved.