Automatic speech to text converstion using Amazon Transcribe Service and link with S3 Bucket

Поділитися
Вставка
  • Опубліковано 20 вер 2024
  • steps to complet the project:
    Scenario One - Send email using S3 Events
    Above is the overall architecture of what we are trying to achieve in this article. We can either choose scenario one or two to receive email notifications. Now without any more explanations let’s dive into the implementation. Following services will be created in AWS in the following order.
    IAM role for Lambda to trigger Transcribe
    Lambda function
    Input and output S3 buckets
    SNS topic
    Create IAM Role for Lambda function with Transcribe Permissions:
    Since our Lambda function is going to trigger AWS Transcribe on behalf of our self we need to give permission to the Lambda function to call Transcribe service. For that let’s create a new IAM role that will be used by our Lambda function.
    Go to IAM Dashboard, select Create a role, and as AWS Service, select Lambda.for our IAM role.
    CloudWatchLogsFullAccess
    AmazonTranscribeFullAccess
    Next, provide a role name and create the new role.
    Create Lambda function for trigger Transcribe Job:
    Next, let’s create the Lambda function which will trigger the AWS Transcribe when we upload a new file to our input S3 bucket(which we will create in the next step).
    Go to Lambda dashboard and Create function. Select Python as the Runtime and on the Execution role select the role we created above.
    Code explanation is given below.
    lnkd.in/ernDhKxs
    The following steps will be followed when the Lambda function is triggered.
    we need to specify the output S3 bucket which we are going to create next. So for now you can remove that field completely.
    Creating Input S3 Bucket and S3 Event to trigger Lambda function:
    After creating the S3 bucket go to properties and Event Notifications. Here is where we configure the S3 event to trigger the Lambda function we created whenever a new object is added to this bucket.
    Click on Create event notification and then provide a name. On Event types select All object create events. This will make sure to create an event when either a new object is uploaded, a rename happened on an existing object or a new object is copied directly to the bucket. For the Destination select the Lambda function we created.
    Now let’s start creating our output S3 bucket where the results from our AWS Transcribe will be available. First, create a new S3 bucket.
    Then first we need to create a new policy specifying write access to this S3 bucket. Go to the IAM dashboard and navigate to Policies. Then click on Create Policy and select JSON and add the following Policy.For this go back again to Lambda role we created earlier and attach this newly created policy to it.
    As the last step make sure to edit the Lambda function we created with the OutputBucketName And the test by uploading a mp3 file into bucket

КОМЕНТАРІ •