Google 语音 + 自然语言管道

Google Speech + Natural Language pipeline

我正在尝试执行以下操作:

我想创建以下管道(将 运行 在 google 云上)

我知道我可以做语音识别请求,然后使用 API 的结果,直接将其发送到 Natural Language 等

但我想知道这样的管道是否可行。 我尝试使用 Google DataFlow,并使用 Google App Engine,但是我找不到办法用他们制作这种管道。

谢谢

我认为 Google DataFlow 不是您尝试构建的管道的正确选择,主要是因为您没有尝试构建分析管道。我认为它看起来像 link here and go to the "Serverless IoT backends" section. Use the Cloud Function for pipe-lining all the processing and then return the result back to your device. Also look at the example here。 虽然我的回答比较笼统,但希望能给你一些尝试的方向。

如果您只有一台设备产生语音输入,像这样的简单解决方案就足够了(将图像替换为音频,将 translation/vision api 替换为 speech/natural 语言 apis):

云存储可以触发云函数,而云函数又可以使用云pub/sub触发其他云函数。

有关详细信息,请参阅此 link

Cloud Functions 是必经之路。这是一个演示应用程序,它利用 Cloud Vision API、GMail API、PubSub 和 CloudFunctions 构建智能 GMail 标签服务。

架构图

Link 到代码:https://github.com/GoogleCloudPlatform/cloud-functions-gmail-nodejs

Link 到博客post: https://cloud.google.com/blog/products/application-development/adding-custom-intelligence-to-gmail-with-serverless-on-gcp

在您的情况下,架构流程可能如下所示
1. 将音频从 Raspberry Pi 发送到 Cloud Storage 存储桶
2. 使用 Cloud Function 监听 Cloud Storage 存储桶中的变化 (Reference)
3. 触发从 Cloud Function 调用 Cloud Speech API 以转录音频
4. 再使用一个 Cloud Function 触发对 NLP 的调用 API
5.做post-处理并写入输出桶
6. 使用云函数监听输出桶并触发调用将输出发送回 Raspberry Pi。