在哪里可以找到 Cloud Speech-to-Text API 调用的存储结果?

Where to find stored results from a Cloud Speech-to-Text API call?

我正在使用 Google 的 Cloud Speech-to-Text 执行一批异步 long_running_recognize 转录,我的一些请求似乎超时了,and/or不返回任何东西。如何访问我的 API 调用的存储结果?我正在使用 Python 3.7.

我意识到 API 调用 returns 结果是调用的函数。我要问的是,Google 是否将我的 API 调用的结果存储在某处?我如何访问它们?

提交较大的音频文件时,您可能应该调用异步方法。具体来说,这会调用 Long运行Recognize 方法。这应该提交一个长 运行 操作并且应该 return 立即响应,例如:

{
  "name": "operation_name",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.speech.v1.LongRunningRecognizeMetadata"
    "progressPercent": 34,
    "startTime": "2016-08-30T23:26:29.579144Z",
    "lastUpdateTime": "2016-08-30T23:26:29.826903Z"
  }
}

通过此响应,您可以轮询给定 operation_name:

的结果
curl -H "Authorization: Bearer "$(gcloud auth application-default print-access-token) \
     -H "Content-Type: application/json; charset=utf-8" \
     "https://speech.googleapis.com/v1/operations/your-operation-name"

注意:当您使用此方法未收到任何 return 值时,我建议增加客户端的超时和重试。这可以通过类似的方式完成:

long_running_recognize(retry=10, timeout=300)

Source