Watson Speech to Text 响应时间 [英] Watson Speech to Text Response Times

查看:24
本文介绍了Watson Speech to Text 响应时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在推送到 Bluemix 时遇到一些服务问题

Having some troubles with the service while pushing to Bluemix

我通过 php-curl 发送的推送请求是:

The push request I am sending via php-curl is:

POST https://stream.watsonplatform.net/speech-to-text/api/v1/recognize

带有以下参数

型号:en-US_NarrowbandModel
内容类型:音频/wav;费率:8000
传输编码:分块
时间戳:真
word_confidence : 真
连续:真

    model : en-US_NarrowbandModel
    Content-Type :  audio/wav; rate: 8000
    Transfer-Encoding: chunked
    timestamps : true
    word_confidence : true
    continuous : true

响应超时设置为 2h(7200000 毫秒)

Response timeout is set to 2h (7200000 milliseconds)

我们的某些文件从 curl 超时,没有任何明显的原因,起初我认为这与录音的持续时间有关,但我在日志中成功请求了大约 200 秒的音频文件和录音超时 129 秒.

We are getting timeout from curl for some of our files, without any apparent reason, at first I thought was related to the duration of the recordings, but I've got in logs with successful requests for audio files ~200 seconds long and timeouts for recordings 129 seconds.

我认为这可能是超时问题或音频文件上传中的一些错误,所以我开始研究会话,但我不清楚会话过程如何工作,我无法在文档中对其进行整理.

I thought it may be a timeout problem or some errors in the audio file upload, so I started looking into the sessions but it is unclear to me how to the session process works and I cant sort it out in the documentation.

以下文档(https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/speech-to-text/api/v1/)

如果我能得到一些关于我做错了什么的反馈/建议,我会很高兴......

I would be really glad if I can get some feedback / advise on what I am doing wrong...

谢谢...

推荐答案

如果您提交的文件很长,那么 REST 接口可能会导致超时,即使您使用会话也是如此.通常,我建议您尝试使用 Watson Speech To Text 服务的 WebSockets 接口.这个接口也比带有会话的 REST 接口简单很多,你应该没有任何超时问题.如果您的文件包含很长的静音,请不要忘记将 inactivity_timeout 参数设置为更高的值,例如 600.

If the file that you are submitting is long then the REST interface may result in timeouts, even if you use sessions. In general, I recomend you to try the WebSockets interface to the Watson Speech To Text service. This interface is also a lot simpler than the REST interface with sessions, and you should not have any problem with timeouts. If your file contains very long silences please do not forget to set the inactivity_timeout parameter to a higher value, for example 600.

文档在这里:

https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/speech-to-text/websockets.shtml

这里有一个简单的 Python 工作示例:

A simple working example in python is here:

https://github.com/watson-developer-云/语音到文本-websockets-python

丹妮

这篇关于Watson Speech to Text 响应时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆