Creating categories for post-call transcriptions - Amazon Transcribe

Creating categories for post-call transcriptions

Post-call analytics supports the creation of custom categories, enabling you to tailor your transcript analyses to best suit your specific business needs.

You can create as many categories as you like to cover a range of different scenarios. For each category you create, you must create between 1 and 20 rules. Each rule is based on one of four criteria: interruptions, keywords, non-talk time, or sentiment. For more details on using these criteria with the CreateCallAnalyticsCategory operation, refer to the Rule criteria for post-call analytics categories section.

If the content in your media matches all the rules you've specified in a given category, Amazon Transcribe labels your output with that category. See call categorization output for an example of a category match in JSON output.

Here are a few examples of what you can do with custom categories:

  • Isolate calls with specific characteristics, such as calls that end with a negative customer sentiment

  • Identify trends in customer issues by flagging and tracking specific sets of keywords

  • Monitor compliance, such as an agent speaking (or omitting) a specific phrase during the first few seconds of a call

  • Gain insight into customer experience by flagging calls with many agent interruptions and negative customer sentiment

  • Compare multiple categories to measure correlations, such as analyzing whether an agent using a welcome phrase correlates with positive customer sentiment

Post-call versus real-time categories

When creating a new category, you can specify whether you want it created as a post-call analytics category (POST_CALL) or as a real-time Call Analytics category (REAL_TIME). If you don't specify an option, your category is created as a post-call category by default. Post-call analytics category matches are available in your output upon completion of your post-call analytics transcription.

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

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

  2. Choose Call analytics categories, which takes you to the Call analytics categories page. Select Create category.

    Amazon Transcribe console screenshot: the Call Analytics 'categories' page.
  3. You're now on the Create category page. Enter a name for your category, then choose 'Batch call analytics' in the Category type dropdown menu.

    Amazon Transcribe console screenshot: the 'category settings' panel.
  4. You can choose a template to create your category or you can make one from scratch.

    If using a template: select Use a template (recommended), choose the template you want, then select Create category.

    Amazon Transcribe console screenshot: the 'category settings' panel showing optional templates.
  5. If creating a custom category: select Create from scratch.

    Amazon Transcribe console screenshot: the 'create category' page showing 'rules' pane.
  6. Add rules to your category using the dropdown menu. You can add up to 20 rules per category.

    Amazon Transcribe console screenshot: the 'rules' pane with list of rule types.
  7. Here's an example of a category with two rules: an agent who interrupts a customer for more than 15 seconds during the call and a negative sentiment felt by the customer or the agent in the last two minutes of the call.

    Amazon Transcribe console screenshot: the 'rules' pane with two example rules.
  8. When you're finished adding rules to your category, choose Create category.

This example uses the create-call-analytics-category command. For more information, see CreateCallAnalyticsCategory, CategoryProperties, and Rule.

The following example creates a category with the rules:

  • The customer was interrupted in the first 60,000 milliseconds. The duration of these interruptions lasted at least 10,000 milliseconds.

  • There was a period of silence that lasted at least 20,000 milliseconds between 10% into the call and 80% into the call.

  • The agent had a negative sentiment at some point in the call.

  • The words "welcome" or "hello" were not used in the first 10,000 milliseconds of the call.

This example uses the create-call-analytics-category command, and a request body that adds several rules to your category.

aws transcribe create-call-analytics-category \ --cli-input-json file://filepath/my-first-analytics-category.json

The file my-first-analytics-category.json contains the following request body.

{ "CategoryName": "my-new-category", "InputType": "POST_CALL", "Rules": [ { "InterruptionFilter": { "AbsoluteTimeRange": { "First": 60000 }, "Negate": false, "ParticipantRole": "CUSTOMER", "Threshold": 10000 } }, { "NonTalkTimeFilter": { "Negate": false, "RelativeTimeRange": { "EndPercentage": 80, "StartPercentage": 10 }, "Threshold": 20000 } }, { "SentimentFilter": { "ParticipantRole": "AGENT", "Sentiments": [ "NEGATIVE" ] } }, { "TranscriptFilter": { "Negate": true, "AbsoluteTimeRange": { "First": 10000 }, "Targets": [ "welcome", "hello" ], "TranscriptFilterType": "EXACT" } } ] }

This example uses the AWS SDK for Python (Boto3) to create a category using the CategoryName and Rules arguments for the create_call_analytics_category method. For more information, see CreateCallAnalyticsCategory, CategoryProperties, and Rule.

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.

The following example creates a category with the rules:

  • The customer was interrupted in the first 60,000 milliseconds. The duration of these interruptions lasted at least 10,000 milliseconds.

  • There was a period of silence that lasted at least 20,000 milliseconds between 10% into the call and 80% into the call.

  • The agent had a negative sentiment at some point in the call.

  • The words "welcome" or "hello" were not used in the first 10,000 milliseconds of the call.

from __future__ import print_function import time import boto3 transcribe = boto3.client('transcribe', 'us-west-2') category_name = "my-new-category" transcribe.create_call_analytics_category( CategoryName = category_name, InputType = POST_CALL, Rules = [ { 'InterruptionFilter': { 'AbsoluteTimeRange': { 'First': 60000 }, 'Negate': False, 'ParticipantRole': 'CUSTOMER', 'Threshold': 10000 } }, { 'NonTalkTimeFilter': { 'Negate': False, 'RelativeTimeRange': { 'EndPercentage': 80, 'StartPercentage': 10 }, 'Threshold': 20000 } }, { 'SentimentFilter': { 'ParticipantRole': 'AGENT', 'Sentiments': [ 'NEGATIVE' ] } }, { 'TranscriptFilter': { 'Negate': True, 'AbsoluteTimeRange': { 'First': 10000 }, 'Targets': [ 'welcome', 'hello' ], 'TranscriptFilterType': 'EXACT' } } ] ) result = transcribe.get_call_analytics_category(CategoryName = category_name) print(result)

Rule criteria for post-call analytics categories

This section outlines the types of custom POST_CALL rules that you can create using the CreateCallAnalyticsCategory API operation.

Interruption match

Rules using interruptions (InterruptionFilter data type) are designed to match:

  • Instances where an agent interrupts a customer

  • Instances where a customer interrupts an agent

  • Any participant interrupting the other

  • A lack of interruptions

Here's an example of the parameters available with InterruptionFilter:

"InterruptionFilter": { "AbsoluteTimeRange": { Specify the time frame, in milliseconds, when the match should occur }, "RelativeTimeRange": { Specify the time frame, in percentage, when the match should occur }, "Negate": Specify if you want to match the presence or absence of interruptions, "ParticipantRole": Specify if you want to match speech from the agent, the customer, or both, "Threshold": Specify a threshold for the amount of time, in seconds, interruptions occurred during the call },

Refer to CreateCallAnalyticsCategory and InterruptionFilter for more information on these parameters and the valid values associated with each.

Keyword match

Rules using keywords (TranscriptFilter data type) are designed to match:

  • Custom words or phrases spoken by the agent, the customer, or both

  • Custom words or phrases not spoken by the agent, the customer, or both

  • Custom words or phrases that occur in a specific time frame

Here's an example of the parameters available with TranscriptFilter:

"TranscriptFilter": { "AbsoluteTimeRange": { Specify the time frame, in milliseconds, when the match should occur }, "RelativeTimeRange": { Specify the time frame, in percentage, when the match should occur }, "Negate": Specify if you want to match the presence or absence of your custom keywords, "ParticipantRole": Specify if you want to match speech from the agent, the customer, or both, "Targets": [ The custom words and phrases you want to match ], "TranscriptFilterType": Use this parameter to specify an exact match for the specified targets }

Refer to CreateCallAnalyticsCategory and TranscriptFilter for more information on these parameters and the valid values associated with each.

Non-talk time match

Rules using non-talk time (NonTalkTimeFilter data type) are designed to match:

  • The presence of silence at specified periods throughout the call

  • The presence of speech at specified periods throughout the call

Here's an example of the parameters available with NonTalkTimeFilter:

"NonTalkTimeFilter": { "AbsoluteTimeRange": { Specify the time frame, in milliseconds, when the match should occur }, "RelativeTimeRange": { Specify the time frame, in percentage, when the match should occur }, "Negate": Specify if you want to match the presence or absence of speech, "Threshold": Specify a threshold for the amount of time, in seconds, silence (or speech) occurred during the call },

Refer to CreateCallAnalyticsCategory and NonTalkTimeFilter for more information on these parameters and the valid values associated with each.

Sentiment match

Rules using sentiment (SentimentFilter data type) are designed to match:

  • The presence or absence of a positive sentiment expressed by the customer, agent, or both at specified points in the call

  • The presence or absence of a negative sentiment expressed by the customer, agent, or both at specified points in the call

  • The presence or absence of a neutral sentiment expressed by the customer, agent, or both at specified points in the call

  • The presence or absence of a mixed sentiment expressed by the customer, agent, or both at specified points in the call

Here's an example of the parameters available with SentimentFilter:

"SentimentFilter": { "AbsoluteTimeRange": { Specify the time frame, in milliseconds, when the match should occur }, "RelativeTimeRange": { Specify the time frame, in percentage, when the match should occur }, "Negate": Specify if you want to match the presence or absence of your chosen sentiment, "ParticipantRole": Specify if you want to match speech from the agent, the customer, or both, "Sentiments": [ The sentiments you want to match ] },

Refer to CreateCallAnalyticsCategory and SentimentFilter for more information on these parameters and the valid values associated with each.