hiro
hiro

Reputation: 1

How to change the language of Speech to Text in IBM Cloud?

I want to try the speech to text in Japanese. I refer to the following web site. https://www.ibm.com/think/jp-ja/watson/ai-transcription/

I changed the audio file in Japanese, but the result of the analysis was English. Please tell me how to change the language?

I used the following command in command prompt.

curl -X POST -u <username>:<password>
--header "Content-Type: audio/flac"
--header "Transfer-Encoding: chunked"
--data-binary @<path>audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true"

According to the Web site https://console.bluemix.net/docs/services/speech-to-text/input.html there is a parameter model, so that I tried to add the parameter like model:ja-JP_BroadbandModel. However the result of analysis didn't change.

Upvotes: 0

Views: 780

Answers (1)

Sayuri Mizuguchi
Sayuri Mizuguchi

Reputation: 5330

As you can see in the Official API Reference, the model is a query parameter, like the keywords_threshold parameter and you can check in the official example from IBM Developers that they insert this parameter in the url, like the example:

curl -X POST -u "{username}":"{password}"
--header "Content-Type: audio/flac"
--data-binary "@audio-file1.flac"
--data-binary "@audio-file2.flac"
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?timestamps=true&word_alternatives_threshold=0.9&keywords=%22colorado%22%2C%22tornado%22%2C%22tornadoes%22&keywords_threshold=0.5"

You can verify in this cURL the last parameter is keywords_threshold. So, you need to do the same in your cURL to specify the model parameter.

Example:

curl -X POST -u <username>:<password>
--header "Content-Type: audio/flac"
--header "Transfer-Encoding: chunked"
--data-binary @<path>audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true&model=ja-JP_BroadbandModel"
  • Official API Reference using cURL.

Upvotes: 2

Related Questions