[Update] Amazon Transcribe Adds a Synchronous API, TranscribeAudio, So I Compared It with Batch Transcription
This page has been translated by machine translation. View original
Introduction
Amazon Transcribe has added TranscribeAudio, an API for transcribing audio files.
Until now, to transcribe an audio file, you first had to start a batch transcription job and keep polling its status until it completed.
With TranscribeAudio, on the other hand, you can easily transcribe audio with just an API call.
In this article, I will transcribe Japanese audio with TranscribeAudio and compare it with the conventional batch transcription.
TranscribeAudio Specifications
The main specifications are as follows[1].
| Item | Details |
|---|---|
| How to provide audio | Include it directly in the request (up to 25 MB) or specify an S3 URI (up to 500 MB) |
| Audio length | 0.5 seconds to 1 hour |
| Formats | WAV, MP3, FLAC, M4A, MP4, Ogg, WebM, AMR |
| Languages | English, Spanish, French, Italian, German, Japanese, Portuguese, Korean, Chinese |
| How to receive results | Included in the response. If you specify OutputConfiguration, it is written to S3 |
| Pricing | 0.0070 USD / minute, billed per second |
Speaker diarization, automatic language identification, custom vocabulary, and channel identification are included in the base price, and only PII redaction costs extra.
Custom vocabulary is also supported, and you can use it either by specifying the name of a vocabulary created in advance or by writing the terms directly in the request.
Trying It Out
In the AWS CLI, you specify the audio file with MediaBytes@=fileb://.
aws transcribe transcribe-audio \
--media MediaBytes@=fileb://meeting-10s.wav \
--language ja
{
"TranscriptResponse": {
"Metadata": {
"MediaFormat": "wav",
"MediaSampleRateHertz": 16000
},
"Results": {
"Transcript": "本日 の 定例 会議 を 始め ます まず 先週 の 振り返り です 新しい 問い合わせ フォーム は 予定 通り 月曜 日 に 公開 し まし た",
"Items": [
{
"Id": 0,
"Content": "本日",
"StartTime": 0.06,
"EndTime": 0.58
},
{
"Id": 1,
"Content": "の",
"StartTime": 0.58,
"EndTime": 0.7
},
{
"Id": 2,
"Content": "定例",
"StartTime": 0.7,
"EndTime": 1.22
}
]
// ...
}
}
}
The transcription came back as the response! The full transcription is in Transcript, and the version split by word is in the Items array.
Comparison with Batch Transcription
Time Required
The measured ranges are as follows.
- TranscribeAudio: from calling the API until the response is returned
- Batch transcription: from calling
StartTranscriptionJob, checking for completion withGetTranscriptionJobevery second, until the result JSON has been retrieved
The medians of five measurements each are as follows.
| Audio length | TranscribeAudio (direct) | TranscribeAudio (S3) | Batch transcription |
|---|---|---|---|
| 10 seconds | 0.66 s | 0.67 s | 7.53 s |
| 1 minute | 1.68 s | 1.66 s | 11.71 s |
| 10 minutes | 6.54 s | 5.86 s | 39.03 s |
Regardless of the audio length, TranscribeAudio returned results in less than one-sixth of the time of batch transcription!
For 10 seconds of audio it takes less than a second, so it seems that even interactive applications wouldn't feel like they're making users wait.
There was almost no difference between including the audio directly and having it read from S3; for the 10-minute audio, including it directly was only about 0.7 seconds slower.
This is probably the time needed to upload about 19 MB of audio data.
Difference in Accuracy
I compared the transcription results for the same audio.
| Script that was read aloud | TranscribeAudio | Batch transcription |
|---|---|---|
| There were one hundred twenty inquiries in the three days since release | In the 3 days since release there were 120 inquiries | Since release, in 3 days, inquiries were, 120 points |
| The work is expected to take one hour, from twenty-two o'clock to twenty-three o'clock | The work time is from 22:00 to 23:00 and 1 hour is expected | The work time is, from :00 to :00, expected to be 1 hour. |
| Compared to the previous month, it increased by eight percent | Compared to the previous month it increased by 8% | Compared to the previous month, 8 increased. |
The What's New announcement says the accuracy is the same as batch transcription, but in this case, TranscribeAudio was more accurate overall. The internal processing may not be exactly the same.
Also, with batch transcription the result is a normal sentence with punctuation, whereas with TranscribeAudio there is no punctuation and spaces are inserted between words, which is a formatting difference.
Conclusion
After actually trying it, I found it to be a convenient API that is easy to use when you want to transcribe recorded audio. Personally, I feel it is far easier to handle than the conventional batch transcription.
If you have been using Amazon Transcribe for transcription processing until now, please give it a try!