Skip to content

Commit

Permalink
feat(speech-to-text): optional parameter force added to the method …
Browse files Browse the repository at this point in the history
…`upgradeAcousticModel`
  • Loading branch information
dpopp07 committed Feb 5, 2019
1 parent d9dc7cc commit ceaa843
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions speech-to-text/v1-generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { getMissingParams } from '../lib/helper';
import { FileObject } from '../lib/helper';

/**
* The IBM® Speech to Text service provides APIs that use IBM's speech-recognition capabilities to produce transcripts of spoken audio. The service can transcribe speech from various languages and audio formats. It addition to basic transcription, the service can produce detailed information about many different aspects of the audio. For most languages, the service supports two sampling rates, broadband and narrowband. It returns all JSON response content in the UTF-8 character set. For speech recognition, the service supports synchronous and asynchronous HTTP Representational State Transfer (REST) interfaces. It also supports a WebSocket interface that provides a full-duplex, low-latency communication channel: Clients send requests and audio to the service and receive results over a single connection asynchronously. The service also offers two customization interfaces. Use language model customization to expand the vocabulary of a base model with domain-specific terminology. Use acoustic model customization to adapt a base model for the acoustic characteristics of your audio. For language model customization, the service also supports grammars. A grammar is a formal language specification that lets you restrict the phrases that the service can recognize. Language model customization is generally available for production use with most supported languages. Acoustic model customization is beta functionality that is available for all supported languages.
* The IBM® Speech to Text service provides APIs that use IBM's speech-recognition capabilities to produce transcripts of spoken audio. The service can transcribe speech from various languages and audio formats. In addition to basic transcription, the service can produce detailed information about many different aspects of the audio. For most languages, the service supports two sampling rates, broadband and narrowband. It returns all JSON response content in the UTF-8 character set. For speech recognition, the service supports synchronous and asynchronous HTTP Representational State Transfer (REST) interfaces. It also supports a WebSocket interface that provides a full-duplex, low-latency communication channel: Clients send requests and audio to the service and receive results over a single connection asynchronously. The service also offers two customization interfaces. Use language model customization to expand the vocabulary of a base model with domain-specific terminology. Use acoustic model customization to adapt a base model for the acoustic characteristics of your audio. For language model customization, the service also supports grammars. A grammar is a formal language specification that lets you restrict the phrases that the service can recognize. Language model customization is generally available for production use with most supported languages. Acoustic model customization is beta functionality that is available for all supported languages.
*/

class SpeechToTextV1 extends BaseService {
Expand Down Expand Up @@ -2565,16 +2565,18 @@ class SpeechToTextV1 extends BaseService {
* existing request completes.
*
* You can use the optional `custom_language_model_id` parameter to specify the GUID of a separately created custom
* language model that is to be used during training. Specify a custom language model if you have verbatim
* language model that is to be used during training. Train with a custom language model if you have verbatim
* transcriptions of the audio files that you have added to the custom model or you have either corpora (text files)
* or a list of words that are relevant to the contents of the audio files. For more information, see the **Create a
* custom language model** method.
* or a list of words that are relevant to the contents of the audio files. Both of the custom models must be based on
* the same version of the same base model for training to succeed.
*
* Training can fail to start for the following reasons:
* * The service is currently handling another request for the custom model, such as another training request or a
* request to add audio resources to the model.
* * The custom model contains less than 10 minutes or more than 100 hours of audio data.
* * One or more of the custom model's audio resources is invalid.
* * You passed an incompatible custom language model with the `custom_language_model_id` query parameter. Both custom
* models must be based on the same version of the same base model.
*
* **See also:** [Train the custom acoustic
* model](https://cloud.ibm.com/docs/services/speech-to-text/acoustic-create.html#trainModel).
Expand All @@ -2586,7 +2588,8 @@ class SpeechToTextV1 extends BaseService {
* @param {string} [params.custom_language_model_id] - The customization ID (GUID) of a custom language model that is
* to be used during training of the custom acoustic model. Specify a custom language model that has been trained with
* verbatim transcriptions of the audio resources or that contains words that are relevant to the contents of the
* audio resources.
* audio resources. The custom language model must be based on the same version of the same base model as the custom
* acoustic model. The credentials specified with the request must own both custom models.
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {NodeJS.ReadableStream|void}
Expand Down Expand Up @@ -2659,7 +2662,12 @@ class SpeechToTextV1 extends BaseService {
* custom model.
* @param {string} [params.custom_language_model_id] - If the custom acoustic model was trained with a custom language
* model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before
* the custom acoustic model can be upgraded.
* the custom acoustic model can be upgraded. The credentials specified with the request must own both custom models.
* @param {boolean} [params.force] - If `true`, forces the upgrade of a custom acoustic model for which no input data
* has been modified since it was last trained. Use this parameter only to force the upgrade of a custom acoustic
* model that is trained with a custom language model, and only if you receive a 400 response code and the message `No
* input data modified since last training`. See [Upgrading a custom acoustic
* model](https://cloud.ibm.com/docs/services/speech-to-text/custom-upgrade.html#upgradeAcoustic).
* @param {Object} [params.headers] - Custom request headers
* @param {Function} [callback] - The callback that handles the response.
* @returns {NodeJS.ReadableStream|void}
Expand All @@ -2675,7 +2683,8 @@ class SpeechToTextV1 extends BaseService {
}

const query = {
'custom_language_model_id': _params.custom_language_model_id
'custom_language_model_id': _params.custom_language_model_id,
'force': _params.force
};

const path = {
Expand Down Expand Up @@ -3710,7 +3719,7 @@ namespace SpeechToTextV1 {
export interface TrainAcousticModelParams {
/** The customization ID (GUID) of the custom acoustic 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. */
customization_id: string;
/** The customization ID (GUID) of a custom language model that is to be used during training of the custom acoustic model. Specify a custom language model that has been trained with verbatim transcriptions of the audio resources or that contains words that are relevant to the contents of the audio resources. */
/** The customization ID (GUID) of a custom language model that is to be used during training of the custom acoustic model. Specify a custom language model that has been trained with verbatim transcriptions of the audio resources or that contains words that are relevant to the contents of the audio resources. The custom language model must be based on the same version of the same base model as the custom acoustic model. The credentials specified with the request must own both custom models. */
custom_language_model_id?: string;
headers?: Object;
}
Expand All @@ -3719,8 +3728,10 @@ namespace SpeechToTextV1 {
export interface UpgradeAcousticModelParams {
/** The customization ID (GUID) of the custom acoustic 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. */
customization_id: string;
/** If the custom acoustic model was trained with a custom language model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before the custom acoustic model can be upgraded. */
/** If the custom acoustic model was trained with a custom language model, the customization ID (GUID) of that custom language model. The custom language model must be upgraded before the custom acoustic model can be upgraded. The credentials specified with the request must own both custom models. */
custom_language_model_id?: string;
/** If `true`, forces the upgrade of a custom acoustic model for which no input data has been modified since it was last trained. Use this parameter only to force the upgrade of a custom acoustic model that is trained with a custom language model, and only if you receive a 400 response code and the message `No input data modified since last training`. See [Upgrading a custom acoustic model](https://cloud.ibm.com/docs/services/speech-to-text/custom-upgrade.html#upgradeAcoustic). */
force?: boolean;
headers?: Object;
}

Expand Down

0 comments on commit ceaa843

Please sign in to comment.