Home > Backend Development > Python Tutorial > Get Started with Amazon Transcribe in Easy Steps

Get Started with Amazon Transcribe in Easy Steps

Mary-Kate Olsen
Release: 2024-12-04 02:27:10
Original
760 people have browsed it

INTRODUCTION

Amazon Transcribe is a fully managed, automatic speech recognition (ASR) service that makes it easy for developers to add speech to text capabilities to their applications. [AWS]

Key Features of Amazon Transcribe

  • Batch transcription and Realtime Transcription are Both Available
  • Supports Multiple Languages
  • Speaker Identification
  • Custom Language Model
  • Custom Vocabulary

There are various other features as well. You can go through their website for more information about Amazon Transcribe features and use cases.

Pre Requisite

The only prerequisite is that you should have an AWS Account with sufficient permissions to access Transcribe and S3. You can use Transcribe from the AWS Console or through AWS SDKs available for multiple languages. For this demo, I'll be utilizing a Lambda function with the Python 3.10 runtime to call the Transcribe API.

Creating Transcribe Job

Step 1: Prepare an S3 Bucket

Before creating the Lambda function, ensure you have an S3 bucket set up to store the media file you want to transcribe.

Step 2: Create a Lambda Function

  • Create a Lambda function and attach an IAM role with the following permissions:
    • AmazonTranscribeFullAccess (AWS Managed Policy)
    • S3:GetObject permission (or a fine-grained custom policy if needed).
  • Refer to this article for guidance on setting up a Lambda function.
  • Copy the code from this GitHub repository and paste it into the Lambda function editor.

Step 3: Create a Test Event

Create a test event with the following parameters:

{
  "MediaFileUri": "s3://your-bucket-name/media-file.mp4"
}
Copy after login
Copy after login

Step 4: Deploy and Test the Code

Deploy the Lambda function.
Execute the test event. You will receive a response similar to the following:

Get Started with Amazon Transcribe in Easy Steps

Step 5: Verify the Transcription

Navigate to the AWS Transcribe service in the AWS Management Console to verify and download the transcription output.

Get Started with Amazon Transcribe in Easy Steps

Creating Transcription Downloading Job

Step 1: Create another Lambda Function

  • Create another Lambda function and attach an IAM role with the following permissions:
    • AmazonTranscribeFullAccess (AWS Managed Policy)
    • Copy the code from this GitHub repository and paste it into the Lambda function editor.

Step 2: Create a Test Event

Create a test event with the following parameters:

{
  "MediaFileUri": "s3://your-bucket-name/media-file.mp4"
}
Copy after login
Copy after login

Step 3: Deploy and Test the Code

Deploy the Lambda function.
Execute the test event. You will receive a response similar to the following:

Get Started with Amazon Transcribe in Easy Steps

Conclusion

We have learned how to use Amazon Transcribe for generating transcription of media files.
We have setup two lambda functions for creating transcription job of a media file stored in S3 and downloading transcription.

Hope you have learned something new.
If you liked this article make sure you give it a heart and comment down your suggestions/feedback.

References

  • Transcribe Website
  • Transcribe Boto3 Documentation
  • ChatGPT (for proof reading.)

The above is the detailed content of Get Started with Amazon Transcribe in Easy Steps. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template