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

备选转录

当 Amazon Transcribe 转录音频文件时,它返回具有最高置信度的转录。您可以指定 Amazon Transcribe 返回置信度较低的其他转录。使用备选转录可查看对所转录音频的不同解释。例如,在允许用户查看转录的应用程序中,您可以提供备选转录供用户选择。备选转录仅适用于 StartTranscriptionJob 操作。

您可以使用控制台或使用 Amazon Transcribe API 将 Amazon Transcribe 配置为返回备选转录。要使用 API 获取备选转录,请将 ShowAlternatives 字段设置为 true 并将 MaxAlternatives 字段设置为当调用 StartTranscriptionJob 操作时要返回的备选转录数。您可以指定 Amazon Transcribe 最多返回 10 个备选转录。

您可以将备选转录与发言者识别和频道识别相结合。转录可用于所有受支持的语言。

备选转录在转录的段级别上提供。段由语音中的自然停顿定义,如发言者变更或音频中的停顿。例如,讲述的语句“今天西雅图下雨,但波特兰不下雨”分为两个部分:“今天西雅图下雨”和“但波特兰不下雨”。

Amazon Transcribe 返回响应中音频文件的整体转录。当您将 Amazon Transcribe 配置为返回备选转录时,总体转录是从具有最高置信度的段备选转录构建的。在输出 JSON 的 segments 结构中返回备选转录。如果 Amazon Transcribe 找不到备选转录,则返回的数量少于在 MaxAlternatives 字段中指定的备选转录数量。

以下是来自 Amazon Transcribe 的 JSON 输出。下面是此输入的转录输出:Uh, you can just call this number if I don't pick up, just leave a voicemail and I'll get back to you. Okay. And that's the number. The 1166 number, you mean?

以下是 ShowAlternatives 设置为 false 时的 JSON 输出。

{ "results": { "transcripts": [ "Uh, you can just call this number if I don't pick up and leave a voicemail and I'll get back to you. Okay. And that's the number. The 1166 number, you mean" ], "items": [ { "start_time": 12.35, "end_time": 12.57, "alternatives": [ { "confidence": 0.9989, "content": "Uh" } ], "type": "pronunciation" }, Items removed for brevity. ] } }

以下是 ShowAlternatives 设置为 trueMaxAlternatives 设置为 2 时的相同输入的 JSON 输出。

{ "results": { "transcripts": [ "Uh, you can just call this number if I don't pick up and leave a voicemail and I'll get back to you. Okay. And that's the number. The 1166 number, you mean" ], "items": [ { "start_time": 12.35, "end_time": 12.57, "alternatives": [ { "confidence": 0.9989, "content": "Uh" } ], "type": "pronunciation" }, Items removed for brevity.. ], "segments": [ { "start_time": 11.84, "end_time": 19.665, "alternatives": [ { "transcript": "Uh, you can just call this number if I don't pick up and leave a voicemail and I'll get back to you.", "items": [ { "start_time": 12.35, "end_time": 12.57, "confidence": 0.9989, "content": "Uh", "type": "pronunciation" }, Items removed for brevity. { "start_time": 16.42, "end_time": 16.52, "confidence": 0.7572, "content": "and", "type": "pronunciation" }, Items removed for brevity. ] }, { "transcript": "Uh, you can just call this number if I don't pick up, just leave a voicemail and I'll get back to you.", "items": [ { "start_time": 12.35, "end_time": 12.57, "confidence": 0.9989, "content": "Uh", "type": "pronunciation" }, Items removed for brevity.. { "start_time": 16.42, "end_time": 16.52, "content": ",", "type": "punctuation" }, { "start_time": 16.42, "end_time": 16.52, "confidence": 0.8934, "content": "just", "type": "punctuation" }, Items removed for brevity.. ] }, Alternatives removed for brevity. ] }, Segments removed for brevity.. ] } }