

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# リアルタイム文字起こしのカテゴリの作成
<a name="tca-categories-stream"></a>

リアルタイムコール分析はカスタムカテゴリの作成をサポートしており、これを使用して特定のビジネスニーズに合わせてトランスクリプト分析を調整できます。

さまざまなシナリオをカバーするカテゴリをいくつでも作成できます。作成するカテゴリごとに、1 から 20 のルールを作成する必要があります。リアルタイムコール分析の文字起こしでは、[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html) (キーワードマッチ) を使用するルールのみがサポートされます。[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html) オペレーションでルールを使用する詳細については、「[リアルタイムコール分析カテゴリのルールの条件](#tca-rules-stream) セクション」を参照してください。

メディア内のコンテンツが、指定したカテゴリのすべてのルールに一致する場合、 Amazon Transcribe は出力にそのカテゴリのラベル付けを行います。JSON 出力形式のカテゴリマッチの例については、「[カテゴリイベント出力](tca-output-streaming.md#tca-output-category-event-stream)」を参照してください。

カスタムカテゴリを使用してできるその他の例を紹介します。
+ 特定のキーワードセットにフラグを付けて追跡することで、早急な対応が必要な問題を特定できます。
+ エージェントが特定のフレーズを話す (または省略) など、コンプライアンスをモニタリングする
+ 特定の単語やフレーズにリアルタイムでフラグを付け、カテゴリマッチを設定して即時アラートを設定できます。たとえば、「*マネージャーと話す*」と言うお客様についてのリアルタイムコール分析カテゴリを作成した場合、このリアルタイムのカテゴリマッチに対して、勤務中のマネージャーに通知する[イベントアラート](tca-start-stream.md#tca-create-alert-stream)を設定できます。

**通話後カテゴリとリアルタイムカテゴリ**

新しいカテゴリを作成する場合、通話後カテゴリ (`POST_CALL`) として作成するか、リアルタイムカテゴリ (`REAL_TIME`) として作成するかを指定できます。オプションを指定しない場合、カテゴリはデフォルトで通話後カテゴリとして作成されます。リアルタイムのカテゴリマッチは、リアルタイムのアラートを作成するために使用することができます。詳細については、「[カテゴリマッチに関するリアルタイムアラートの作成](tca-start-stream.md#tca-create-alert-stream)」を参照してください。

リアルタイム通話分析の新しいカテゴリを作成するには、**AWS マネジメントコンソール**、**AWS CLI**、または **AWS SDK** を使用できます。例については以下を参照してください。

## AWS マネジメントコンソール
<a name="tca-category-console"></a>

1. ナビゲーションペインで、**Amazon Transcribe 分析の呼び出し** Amazon Transcribeを選択します。

1. [**コール分析カテゴリ**] を選択すると、[**コール分析カテゴリ**] ページに移動します。「**カテゴリの作成**」ボタンを選択します。  
![\[Amazon Transcribe コンソールのスクリーンショット: Call Analytics の「カテゴリ」ページ。\]](http://docs.aws.amazon.com/ja_jp/transcribe/latest/dg/images/analytics-categories.png)

1. [**カテゴリの作成ページ**] が表示されます。カテゴリの名前を入力し、**カテゴリタイプ**のドロップダウンメニューで [リアルタイムコール分析] を選択します。  
![\[Amazon Transcribe コンソールのスクリーンショット: 「カテゴリ設定」パネル。\]](http://docs.aws.amazon.com/ja_jp/transcribe/latest/dg/images/analytics-categories-type.png)

1. テンプレートを選択してカテゴリを作成することも、一から作成することもできます。

   テンプレートを使用する場合: [**テンプレートを使用する (推奨)**] を選択し、必要なテンプレートを選択してから [**カテゴリの作成**] を選択します。  
![\[Amazon Transcribe コンソールのスクリーンショット: オプションのテンプレートを示す「カテゴリ設定」パネル。\]](http://docs.aws.amazon.com/ja_jp/transcribe/latest/dg/images/analytics-categories-settings-stream.png)

1. カスタムカテゴリを作成する場合: [**最初から作成**] を選択します。  
![\[Amazon Transcribe コンソールのスクリーンショット：「ルール」ペインを示す「カテゴリの作成」ページ。\]](http://docs.aws.amazon.com/ja_jp/transcribe/latest/dg/images/analytics-categories-custom.png)

1. ドロップダウンメニューを使用して、カテゴリにルールを追加します。1 つのカテゴリには最大 20 ルールまで追加できます。リアルタイムコール分析文字起こしでは、トランスクリプトの内容が一致するルールのみを含めることができます。一致した場合はリアルタイムでフラグが付けられます。  
![\[Amazon Transcribe コンソールのスクリーンショット: ルールタイプのリストを含む「ルール」ペイン。\]](http://docs.aws.amazon.com/ja_jp/transcribe/latest/dg/images/analytics-categories-custom-rules-stream.png)

1. ルールが 1 つあるカテゴリの例を次に示します。お客様が通話中どの時点でも「マネージャーと話す」と言っている場合です。  
![\[Amazon Transcribe コンソールのスクリーンショット: ロジックオプションを含む「ルール」ペイン。\]](http://docs.aws.amazon.com/ja_jp/transcribe/latest/dg/images/analytics-categories-custom-rules-stream2.png)

1. カテゴリにルールを追加し終えたら、[**カテゴリの作成**] を選択します。

## AWS CLI
<a name="tca-category-cli-stream"></a>

この例では、[create-call-analytics-category](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/create-call-analytics-category.html) コマンドを使用します。詳細については、「[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html)」、「[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CategoryProperties.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CategoryProperties.html)」、および「[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Rule.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Rule.html)」を参照してください。

以下の例では、ルールを含むカテゴリを作成します。
+ お客様は、通話のどの時点でも「マネージャーと話す」というフレーズを口にしました。

この例は、[create-call-analytics-category](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/transcribe/create-call-analytics-category.html) コマンドと、カテゴリにルールを追加するリクエストボディを使用しました。

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

ファイル *my-first-analytics-category.json* には、次のリクエストボディが含まれています。

```
{
  "CategoryName": "my-new-real-time-category",
  "InputType": "REAL_TIME",
  "Rules": [
        {
            "TranscriptFilter": {
                "Negate": false,
                "Targets": [
                    "speak to the manager"
                ],
                "TranscriptFilterType": "EXACT"
            }
        }
    ]
}
```

## AWS SDK for Python (Boto3)
<a name="tca-category-python-stream"></a>

この例では AWS SDK for Python (Boto3) 、 を使用して、[create\$1call\$1analytics\$1category ](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/transcribe.html#TranscribeService.Client.create_call_analytics_category)メソッドの 引数`CategoryName`と `Rules`引数を使用してカテゴリを作成します。詳細については[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html)、[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CategoryProperties.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CategoryProperties.html)、および[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Rule.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_Rule.html)を参照してください。

機能固有の例、シナリオ例、クロスサービス例など、 AWS SDKs[SDK を使用した Amazon Transcribe のコード例 AWS SDKs](service_code_examples.md)「」の章を参照してください。

以下の例では、ルールを含むカテゴリを作成します。
+ お客様は、通話のどの時点でも「マネージャーと話す」というフレーズを口にしました。

```
from __future__ import print_function
import time
import boto3
transcribe = boto3.client('transcribe', 'us-west-2')
category_name = "my-new-real-time-category"
transcribe.create_call_analytics_category(
    CategoryName = category_name,
    InputType = "REAL_TIME",
    Rules = [
        {
            'TranscriptFilter': {
                'Negate': False,
                'Targets': [
                    'speak to the manager'                    
                ],
                'TranscriptFilterType': 'EXACT'
            }
        }
    ]
)

result = transcribe.get_call_analytics_category(CategoryName = category_name)    
print(result)
```

## リアルタイムコール分析カテゴリのルールの条件
<a name="tca-rules-stream"></a>

このセクションでは、[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html) API オペレーションを使用して作成できるカスタム `REAL_TIME` ルールのタイプについて説明します。

問題検出は自動的に行われるため、問題にフラグを付けるためのルールやカテゴリを作成する必要はありません。

リアルタイムコール分析の文字起こしでは、キーワードマッチのみがサポートされます。中断、無音、感情を含むカテゴリを作成したい場合は、「[通話後分析カテゴリのルールの条件](tca-categories-batch.md#tca-rules-batch)」を参照してください。

### キーワードマッチ
<a name="tca-rules-keywords-stream"></a>

キーワード ([https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html) データタイプ) を使用するルールは、以下と一致するように設計されています。
+ エージェント、お客様、あるいはその両方が話すカスタム単語またはフレーズ
+ エージェント、お客様、あるいはその両方が口にし**ない**カスタム単語またはフレーズ
+ 特定の期間に出現するカスタム単語またはフレーズ

[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html) で使用できるパラメータの例を以下に示します。

```
"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
}
```

これらのパラメータとそれぞれに関連する有効な値の詳細については、「[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_CreateCallAnalyticsCategory.html)」および「[https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_TranscriptFilter.html)」を参照してください。