Using a model for speech recognition
You use the model
parameter of a speech recognition request to indicate the model that is to be used with the request. You can specify a large speech model, previous- or next-generation model with the parameter.
For more information about the models that are available for speech recognition, see
- Previous-generation languages and models
- Next-generation languages and models
- Large speech languages and models
Specify a previous-generation model example
The following example HTTP request uses the previous-generation model en-US_NarrowbandModel
for speech recognition:
IBM Cloud
curl -X POST -u "apikey:{apikey}" \
--header "Content-Type: audio/flac" \
--data-binary @{path}audio-file.flac \
"{url}/v1/recognize?model=en-US_NarrowbandModel"
IBM Cloud Pak for Data
curl -X POST \
--header "Authorization: Bearer {token}" \
--header "Content-Type: audio/flac" \
--data-binary @{path}audio-file.flac \
"{url}/v1/recognize?model=en-US_NarrowbandModel"
Specify a next-generation model example
The following example HTTP request uses the next-generation en-US_Telephony
model for speech recognition:
IBM Cloud
curl -X POST -u "apikey:{apikey}" \
--header "Content-Type: audio/wav" \
--data-binary @{path}audio-file.wav \
"{url}/v1/recognize?model=en-US_Telephony"
IBM Cloud Pak for Data
curl -X POST \
--header "Authorization: Bearer {token}" \
--header "Content-Type: audio/wav" \
--data-binary @{path}audio-file.wav \
"{url}/v1/recognize?model=en-US_Telephony"
Specify a large speech model example
The following example HTTP request uses the large speech model en-US
for speech recognition:
IBM Cloud
curl -X POST -u "apikey:{apikey}" \
--header "Content-Type: audio/wav" \
--data-binary @{path}audio-file.wav \
"{url}/v1/recognize?model=en-US"
IBM Cloud Pak for Data
curl -X POST \
--header "Authorization: Bearer {token}" \
--header "Content-Type: audio/wav" \
--data-binary @{path}audio-file.wav \
"{url}/v1/recognize?model=en-US"
Using the default model
If you omit the model
parameter from a speech recognition request, the service uses the US English en-US_BroadbandModel
by default. This default applies to all speech recognition requests.
IBM Cloud Pak for Data If you do not install the en-US_BroadbandModel
, it cannot serve as the default model. In this case, you must either
- Use the
model
parameter to pass the model that is to be used with each request. - Specify a new default model for your installation of Speech to Text for IBM Cloud Pak for Data by using the
defaultSTTModel
property in the Speech services custom resource. For more information, see Installing Watson Speech to Text.