Starting a post-call analytics transcription - Amazon Transcribe

Starting a post-call analytics transcription

Before starting a post-call analytics transcription, you must create all the categories you want Amazon Transcribe to match in your audio.

Note

Call Analytics transcripts can't be retroactively matched to new categories. Only the categories you create before starting a Call Analytics transcription can be applied to that transcription output.

If you've created one or more categories, and your audio matches all the rules within at least one of your categories, Amazon Transcribe flags your output with the matching category. If you choose not to use categories, or if your audio doesn't match the rules specified in your categories, your transcript isn't flagged.

To start a post-call analytics transcription, you can use the AWS Management Console, AWS CLI, or AWS SDKs; see the following for examples:

Use the following procedure to start a post-call analytics job. The calls that match all characteristics defined by a category are labeled with that category.

  1. In the navigation pane, under Amazon Transcribe Call Analytics, choose Call analytics jobs.

  2. Choose Create job.

    Amazon Transcribe console screenshot: the 'Call Analytics jobs' page.
  3. On the Specify job details page, provide information about your Call Analytics job, including the location of your input data.

    Amazon Transcribe console screenshot: the 'specify job details' page.

    Specify the desired Amazon S3 location of your output data and which IAM role to use.

    Amazon Transcribe console screenshot: the 'access permissions' panel.
  4. Choose Next.

  5. For Configure job, turn on any optional features you want to include with your Call Analytics job. If you previously created categories, they appear in the Categories panel and are automatically applied to your Call Analytics job.

    Amazon Transcribe console screenshot: the 'configure job' page showing all custom categories.
  6. Choose Create job.

This example uses the start-call-analytics-job command and channel-definitions parameter. For more information, see StartCallAnalyticsJob and ChannelDefinition.

aws transcribe start-call-analytics-job \ --region us-west-2 \ --call-analytics-job-name my-first-call-analytics-job \ --media MediaFileUri=s3://DOC-EXAMPLE-BUCKET/my-input-files/my-media-file.flac \ --output-location s3://DOC-EXAMPLE-BUCKET/my-output-files/ \ --data-access-role-arn arn:aws:iam::111122223333:role/ExampleRole \ --channel-definitions ChannelId=0,ParticipantRole=AGENT ChannelId=1,ParticipantRole=CUSTOMER

Here's another example using the start-call-analytics-job command, and a request body that enables Call Analytics for that job.

aws transcribe start-call-analytics-job \ --region us-west-2 \ --cli-input-json file://filepath/my-call-analytics-job.json

The file my-call-analytics-job.json contains the following request body.

{ "CallAnalyticsJobName": "my-first-call-analytics-job", "DataAccessRoleArn": "arn:aws:iam::111122223333:role/ExampleRole", "Media": { "MediaFileUri": "s3://DOC-EXAMPLE-BUCKET/my-input-files/my-media-file.flac" }, "OutputLocation": "s3://DOC-EXAMPLE-BUCKET/my-output-files/", "ChannelDefinitions": [ { "ChannelId": 0, "ParticipantRole": "AGENT" }, { "ChannelId": 1, "ParticipantRole": "CUSTOMER" } ] }

This example uses the AWS SDK for Python (Boto3) to start a Call Analytics job using the start_call_analytics_job method. For more information, see StartCallAnalyticsJob and ChannelDefinition.

For additional examples using the AWS SDKs, including feature-specific, scenario, and cross-service examples, refer to the Code examples for Amazon Transcribe using AWS SDKs chapter.

from __future__ import print_function import time import boto3 transcribe = boto3.client('transcribe', 'us-west-2') job_name = "my-first-call-analytics-job" job_uri = "s3://DOC-EXAMPLE-BUCKET/my-input-files/my-media-file.flac" output_location = "s3://DOC-EXAMPLE-BUCKET/my-output-files/" data_access_role = "arn:aws:iam::111122223333:role/ExampleRole" transcribe.start_call_analytics_job( CallAnalyticsJobName = job_name, Media = { 'MediaFileUri': job_uri }, DataAccessRoleArn = data_access_role, OutputLocation = output_location, ChannelDefinitions = [ { 'ChannelId': 0, 'ParticipantRole': 'AGENT' }, { 'ChannelId': 1, 'ParticipantRole': 'CUSTOMER' } ] ) while True: status = transcribe.get_call_analytics_job(CallAnalyticsJobName = job_name) if status['CallAnalyticsJob']['CallAnalyticsJobStatus'] in ['COMPLETED', 'FAILED']: break print("Not ready yet...") time.sleep(5) print(status)