speech-to-text-websockets-ruby icon indicating copy to clipboard operation
speech-to-text-websockets-ruby copied to clipboard

[Speech to Text] The model parameter for websocket doesn't take effect.

Open alpha-netzilla opened this issue 7 years ago • 2 comments

Hi,

I specified the language model for transcription in params as follows, and prepared a wav file according to the model format.

params = {
     'action'             => "start",
     'model'              => 'ja-JP_BroadbandModel',
     'content-type'       => "audio/wav", 
     'continuous'         => true,
     'inactivity_timeout' => -1,
     'interim_results'    => true
}

However, Speech to Text tries to recognize the uploaded file as the default language model of en-US_BroadbandModel.

Deconstruct the issue, I used the same parameter in Node.js SDK. Speech to Text returned the transcription as desired. https://github.com/watson-developer-cloud/node-sdk

Could you think of anything that might have caused it?

alpha-netzilla avatar Mar 23 '18 09:03 alpha-netzilla

You are specifying a parameter that is not supported by this sample. If you look at the line https://github.com/watson-developer-cloud/speech-to-text-websockets-ruby/blob/master/example.rb#L36 you will see that model is not being used in the url to /recognize.

The model needs to be added to the query string

watson_url = "wss://stream.watsonplatform.net/speech-to-text/api/v1/recognize?
watson-token=#{token.body}&model=ja-JP_BroadbandModel"

germanattanasio avatar Mar 24 '18 02:03 germanattanasio

I see. Thanks!

alpha-netzilla avatar Mar 27 '18 00:03 alpha-netzilla