Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Curl 如何在IBMCloud中将语音语言更改为文本?_Curl_Ibm Cloud_Speech To Text_Ibm Watson - Fatal编程技术网

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参考使用