流式转录 - Amazon Transcribe
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

流式转录

Amazon Transcribe Medical 流式转录使您能够发送音频流并实时接收文本流。此 API 使开发人员能够轻松地向其应用程序添加实时语音到文本功能。

下表显示了哪些语言可用于串流转录以及如何访问它们。

语言 采样率 可用于
美国英语 (en-US) 16 kHz、8 kHz Amazon Transcribe Medical 控制台StartMedicalStreamTranscriptionAPI 和 WebSocket 请求

如果您使用的是 HTTP/2,我们提供了一个 HTTP/2 流客户端,可以在网络存在临时问题时处理重试连接操作。您可以使用此客户端作为您自己的应用程序的起点。要将 Amazon Transcribe Medical 流式传输与 WebSocket 协议一起使用,可以创建自己的客户端。

流式转录可以获取音频数据流并对其进行实时转录。转录将在转录事件流中返回到您的应用程序。

Amazon Transcribe Medical 根据自然语音段中断您的传入音频流,例如,扬声器的更改或音频中的暂停。转录将逐步返回到您的应用程序,每个响应包含更多转录的语音,直到整个片段被转录。

在以下示例中,每一行都是流式传输的音频片段的部分结果转录输出。

The The PE. The pain. The patient. The patient was The patient was in The patient was entered. The patient was entered, and, uh The patient was I/O. The patient was I/0 of The patient was I/0 of some The patient was I/0 sign. The patient was I/0 of Sinus. The patient was I/0 of Sinus rhyth. The patient was I/0 of Sinus rhythm. The patient was I/0 of Sinus rhythm with

响应中的每个结果对象均包含一个名为 IsPartial 的字段,该字段指示响应是否为包含到目前为止的转录结果的部分响应,或是否为音频片段的完整转录。

每个结果对象还包含音频流中期限的开始时间和结束时间,以便您可以将转录与视频同步。

以下示例是部分转录响应。

{ "Transcript": { "Results": [ { "Alternatives": [ { "Items": [ { "Content": "The", "EndTime": 1.07, "StartTime": 1.04, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "patient", "EndTime": 1.5, "StartTime": 1.08, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "was", "EndTime": 1.61, "StartTime": 1.51, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "I/O", "EndTime": 2.25, "StartTime": 2.06, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "of", "EndTime": 2.34, "StartTime": 2.26, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "Sinus", "EndTime": 2.71, "StartTime": 2.35, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "rhythm", "EndTime": 3.07, "StartTime": 2.72, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": "with", "EndTime": 3.68, "StartTime": 3.49, "Type": "pronunciation", "VocabularyFilterMatch": false } ], "Transcript": "The patient was I/O of Sinus rhythm with" } ], "EndTime": 3.75, "IsPartial": true, "ResultId": "93b1df2b-8702-4c91-892a-ace3b65a6477", "StartTime": 1.04 } ] } }

以下示例显示了完全转录的语音段落的转录结果。

{ "Transcript": { "Results": [ { "Alternatives": [ { "Items": [ { "Confidence": 0.99, "Content": "The", "EndTime": 1.12, "StartTime": 1.04, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 0.99, "Content": "patient", "EndTime": 1.53, "StartTime": 1.13, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "was", "EndTime": 1.73, "StartTime": 1.54, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "I/O", "EndTime": 2.3, "StartTime": 2.12, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "of", "EndTime": 2.39, "StartTime": 2.31, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "Sinus", "EndTime": 2.82, "StartTime": 2.4, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 0.99, "Content": "rhythm", "EndTime": 3.32, "StartTime": 2.83, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 0.99, "Content": "with", "EndTime": 3.72, "StartTime": 3.49, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 0.99, "Content": "a", "EndTime": 3.78, "StartTime": 3.73, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "heart", "EndTime": 4.02, "StartTime": 3.79, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "rate", "EndTime": 4.19, "StartTime": 4.03, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 0.99, "Content": "of", "EndTime": 4.26, "StartTime": 4.2, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 1, "Content": "75", "EndTime": 4.81, "StartTime": 4.27, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Confidence": 0.97, "Content": "bpm", "EndTime": 5.47, "StartTime": 4.82, "Type": "pronunciation", "VocabularyFilterMatch": false }, { "Content": ".", "EndTime": 5.47, "StartTime": 5.47, "Type": "punctuation", "VocabularyFilterMatch": false } ], "Transcript": "The patient was I/O of Sinus rhythm with a heart rate of 75 bpm." } ], "EndTime": 5.53, "IsPartial": false, "ResultId": "93b1df2b-8702-4c91-892a-ace3b65a6477", "StartTime": 1.04 } ] } }

转录输出中的每个单词、短语或标点符号都是项目. 每个单词或短语都有信心分数。置信度得分是介于之间的值01这表明 Amazon Transcribe Medical 对于正确转录商品的信心有多大。值较大的信心分数表明 Amazon Transcribe Medical 更有信心正确地转录商品。

前面的示例显示了转录输出中的 “I/O”,这是 “进出” 的缩写。有关 Amazon Transcribe Medical 如何在转录输出中使用缩写的更多信息,请参阅转录医学术语和测量.