自動音声認識(ASR)評価結果の取得API
Note: Submit your skill and see it come to life.
自動音声認識(ASR)評価結果の取得API
このAPIを呼び出すと、詳細なASR評価結果が取得できます。
実行内容はASR評価ステータスの取得APIとは異なります。ASR評価ステータスの取得APIは大まかな情報を返し、アノテーションセットのメタデータ取得APIは詳細な情報を返します。
ASR評価のAPI実行手順の詳細については、APIフローを参照してください。
HTTPメソッドとパス
GET v1/skills/{skillId}/asrEvaluations/{evaluationId}/results HTTP/1.1
アトリビュート | 型 | 説明 | 必須 |
---|---|---|---|
skillId | 文字列 | URIパスに含むスキルIDです。 | ◯ |
evaluationId | 文字列 | URIパスに含む評価IDです。 | ◯ |
status | 列挙 | 評価テスト項目の結果ステータス。指定できる値はPASSEDまたはFAILEDです。このクエリパラメータを省略すると、FAILEDとPASSEDの両方の結果が含まれます。 | ✕ |
nextToken | 文字列 | responseオブジェクトで返された継続トークンです。 | ✕ |
maxResults | 整数 | 表示するテスト項目の結果の最大数。値は1〜1000の間で指定します。デフォルトは1000です。 | ✕ |
リクエスト
リクエストヘッダー
Content-Type: application/json
Accept: application/json
リクエスト本文
なし
応答
HTTPステータス
HTTP 200 OK
応答ヘッダー
Content-Type: application/json
応答本文
{
"paginationContext": {
"nextToken": string
},
"results": [
{
"status": enum["PASSED", "FAILED"],
"annotation": {
"evaluationWeight": integer,
"expectedTranscription": string,
"filePathInUpload": string,
"uploadId": string,
"audioAsset": {
"downloadUrl": string,
"expiryTime": string
}
},
"output": {
"transcription": string
},
"error": {
"message": string,
"code": string
}
}
]
}
アトリビュート | 型 | 説明 | 必須 |
---|---|---|---|
paginationContext | オブジェクト | ページ分割情報を含むオブジェクト。存在する場合、レスポンスには不完全な評価結果が含まれます。存在しない場合、すべての評価結果が既に返されています。 | ✕ |
paginationContext.nextToken | 文字列 | nextTokenの値は、オブジェクトの次のセットのリストを表示する継続トークンとして次のリクエストで使用します。 | ◯ |
results | 配列 | すべての結果を含む配列。 | ◯ |
results[i].status | 列挙 | 結果(合格または不合格)を示す列挙型。値はPASSEDまたはFAILEDです。 | ◯ |
results[i].annotation | オブジェクト | 現在の評価で使用されるアノテーションオブジェクト。有効な値はuploadId、filePathInUpload、evaluationWeight、expectedTranscription、audioAssetです。 | ◯ |
results[i].annotation.audioAsset | オブジェクト | この評価テスト項目で使用されるオーディオのダウンロード情報を含むオブジェクト。 | ◯ |
results[i].annotation.audioAsset.downloadUrl | 文字列 | この評価テスト項目で使用されるオーディオファイルをダウンロードするためのURL。 | ◯ |
results[i].annotation.audioAsset.expiryTime | 文字列 | ダウンロードURLの有効期限のタイムスタンプ。 | ◯ |
results[i].output | オブジェクト | ASR出力を含むオブジェクト。このフィールドが本文に存在しない場合、評価中にエラーが発生しています。応答本文には、テストが失敗した理由に関する情報を含むresults[i].errorオブジェクトが含まれます。 | ✕ |
results[i].output.transcription | 文字列 | ASRによる音声の実際の文字起こし。 | results[i].outputが存在する場合は◯、それ以外は✕。 |
results[i].error | オブジェクト | 評価を実行できない場合、エラーオブジェクトを含みます。 | ✕ |
results[i].error.message | 文字列 | エラーが発生した場合に、音声の評価に失敗した理由を説明するエラーメッセージ。 | results[i].errorが存在する場合は◯、それ以外は✕。 |
results[i].error.code | 文字列 | エラーコード | results[i].errorが存在する場合は◯、それ以外は✕。 |
エラー応答
このセクションでは、リクエスト固有のエラーについて説明します。すべてのASR APIに適用されるエラーのリファレンスについては、自動音声認識(ASR)APIエラーリファレンスを参照してください。
HTTPステータスコード | エラーコード | シナリオ |
---|---|---|
404 Not Found |
RESOURCE_NOT_FOUND |
指定されたスキルが存在しません。 |
指定された評価が存在しません。 |
||
400 Bad Request |
INVALID_REQUEST_PARAMETER |
評価IDの形式が正しくありません。 |
INVALID_ENUM_VALUE |
resultStatusの値が正しくありません。 |
|
PARAMTER_EXPIRED |
nextTokenの有効期限が切れています。 |
|
INVALID_INTEGER_VALUE |
maxResultsの値が許容範囲外です。 |
|
500 Internal Server Error |
INTERNAL_SERVER_ERROR |
内部サーバエラーのため、リクエストが失敗しました。 |
例
サンプルリクエスト | 応答の例 |
---|---|
GET /v1/skills/1234/asrEvaluations/1234-1234-1234-12341234/results HTTP/1.1 Accept: application/json
|
HTTP 200 OK Content-Type: application/json { "results": [ { "status": "PASSED", "annotation": { "evaluationWeight": 1, "expectedTranscription": "hello world", "filePathInUpload": "hello world.wav", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-hello.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, "output": { "transcription": "hello world", } }, { "status": "FAILED", "annotation": { "evaluationWeight": 8, "expectedTranscription": "alexa what is the weather now", "filePathInUpload": "weather.wav", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-weather.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, "output": { "transcription": "alexa what is the weather noon" } }, }, { "status": "PASSED", "annotation": { "evaluationWeight": 1, "expectedTranscription": "alexa good job", "filePathInUpload": "good.mp3", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-good.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, "output": { "transcription": "alexa good job" } } ] } |
GET /v1/skills/1234/asrEvaluations/1234-1234-1234-12341234/results HTTP/1.1 Accept: application/json |
HTTP 200 OK Content-Type: application/json { "results": [ { "status": "FAILED", "annotation": { "evaluationWeight": 8, "expectedTranscription": "alexa what is the weather now", "filePathInUpload": "malformed.wav", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-weather.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, error: { "message": "An unexpected error occurred" "code": "INTERNAL_SERVER_ERROR" } ] } |
GET /v1/skills/1234/asrEvaluations/1234-1234-1234-12341234/results HTTP/1.1 Accept: application/json |
HTTP 200 OK Content-Type: application/json { "paginationContext": { nextToken": "1234-1234" }, "results": [{ "status": "PASSED", "annotation": { "evaluationWeight": 1, "expectedTranscription": "hello world", "filePathInUpload": "hello world.wav", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-hello.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, "output": { "transcription": "hello world" } }, { "status": "FAILED", "annotation": { "evaluationWeight": 8, "expectedTranscription": "alexa what is the weather now", "filePathInUpload": "weather.wav", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-weather.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, "output": { "transcription": "alexa what is the weather noon" } } ] } |
GET /v1/skills/1234/asrEvaluations/1234-1234-1234-12341234/results HTTP/1.1 Accept: application/json |
HTTP 200 OK Content-Type: application/json { "results": [ { "status": "PASSED", "annotation": { "evaluationWeight": 1, "expectedTranscription": "alexa good job", "filePathInUpload": "good.mp3", "uploadId": "1234-1234-12341234", "audioAsset": { "downloadUrl": "https://presign.s3.aws.amazon/123412341234-good.wav", "expiryTime": "2018-10-25T08:25:04.679Z" } }, "output": { "transcription": "alexa good job" } } ] } |
GET /v1/skills/1234/asrEvaluations/1234-1234-1234-12341234/results HTTP/1.1 Accept: application/json |
HTTP 400 Bad Request Content-Type: application/json { "message": "Request validations failed", "violations": [{ "message": "Query parameter \"nextToken\" with value \"1234-1234\" is expired.", "code": "PARAMETER_EXPIRED" }] } |