Curl 如何在IBMCloud中将语音语言更改为文本?
我想试着用日语把演讲稿翻译成文字。我指的是以下网站。 我用日语更改了音频文件,但分析结果是英语。 请告诉我如何改变语言 我在命令提示符中使用了以下命令Curl 如何在IBMCloud中将语音语言更改为文本?,curl,ibm-cloud,speech-to-text,ibm-watson,Curl,Ibm Cloud,Speech To Text,Ibm Watson,我想试着用日语把演讲稿翻译成文字。我指的是以下网站。 我用日语更改了音频文件,但分析结果是英语。 请告诉我如何改变语言 我在命令提示符中使用了以下命令 curl -X POST -u <username>:<password> --header "Content-Type: audio/flac" --header "Transfer-Encoding: chunked" --data-binary @<path>audio-file.flac "https
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"
curl-X POST-u:
--标题“内容类型:音频/flac”
--标题“传输编码:分块”
--data binary@audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true"
根据该网站
有一个参数模型
,
因此,我尝试添加参数,如model:ja-JP\u BroadbandModel
。
但是分析结果没有改变。正如您在中所看到的,模型是一个查询参数
,与关键字(u threshold
参数类似,您可以在IBM开发人员的官方示例中检查他们是否将此参数插入url
,例如:
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"
您可以在此cURL中验证最后一个参数是否为关键字\u阈值
。因此,您需要在cURL中执行相同的操作,以指定model
参数
例如:
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"
curl-X POST-u:
--标题“内容类型:音频/flac”
--标题“传输编码:分块”
--data binary@audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true&model=ja-JP_宽带模式”
- 官方API参考使用
正如您在中所看到的,模型是一个查询参数
,类似于关键字\u阈值
参数,您可以在IBM开发人员的官方示例中检查他们是否在url
中插入此参数,例如:
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"
您可以在此cURL中验证最后一个参数是否为关键字\u阈值
。因此,您需要在cURL中执行相同的操作,以指定model
参数
例如:
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"
curl-X POST-u:
--标题“内容类型:音频/flac”
--标题“传输编码:分块”
--data binary@audio-file.flac
"https://stream.watsonplatform.net/speech-to-text/api/v1/recognize?continuous=true&model=ja-JP_宽带模式”
- 官方API参考使用