要約を有効にする

要約アノテーターは、Customer Experience Insights の会話の要約を返します。要約は Agent Assist の機能で、CX インサイトでのみ使用することも、既存の Agent Assist 会話プロファイルと組み合わせて使用することもできます。このページでは、要約アノテーターを有効にする方法について説明します。

課金

Customer Experience Insights は Agent Assist を使用して会話の要約を生成します。Customer Experience Insights 分析の要約を実装すると、Agent Assist API の使用量に対して請求書に項目が追加されます。詳細については、Agent Assist の料金ページをご覧ください。

AnnotatorSelector

他の分析アノテーターとは異なり、要約アノテーターはデフォルトで無効になっています。AnnotatorSelector.run_summarization_annotatortrue に設定して有効にします。

リクエストで AnnotatorSelector が指定されている場合、CX インサイトは明示的に有効になっているアノテーターを実行します。要約以外のアノテーターを実行するには、リクエストでアノテーターを有効にします。使用可能なオプションについては、 AnnotatorSelector をご覧ください。

前提条件

プロジェクトで Dialogflow APICustomer Experience Insights API を有効にします。 Google Cloud

CX インサイト分析を使用して会話を要約する

会話の分析を作成することで、CX インサイトの会話の要約を生成できます。詳細については、API を使用して会話を作成して分析するをご覧ください。分析を作成すると、アノテーター セレクタを使用して要約が有効になり、構成されます。

各要約モデルでサポートされている言語の一覧については、Agent Assist の言語サポート ドキュメントをご覧ください。

生成ツール要約モデルを使用する

Agent Assist では、生成ツールモデルを使用して、カスタム セクションを含む LLM 駆動型の要約も提供しています。定義済みのセクションを含む生成ツールモデルを使用することも、カスタム セクションを定義することもできます。

LLM 駆動型の生成ツールモデルを使用して要約を自動的に生成する手順は次のとおりです。

  1. Agent Assist の手順に沿って、要約生成ツールを作成します
  2. run_summarization_annotatortrue に設定します。
  3. summarization_configgenerator に設定します。

次に例を示します。

curl -X POST \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    -H "Content-Type: application/json; charset=utf-8" \
    -d '{annotator_selector: {run_summarization_annotator: true, summarization_config: {generator: '"projects/PROJECT_ID/locations/global/generators/generator_id"}}}' \
    "https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID/

要約結果を表示する

分析を作成すると、オペレーション ID が返されます。オペレーションをポーリングして、進行状況を追跡します。分析が完了したら、会話にクエリを実行して分析結果を確認します。

curl -X GET \
    -H "Authorization: Bearer $(gcloud auth print-access-token)" \
    "https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID"

レスポンスに要約データが入力されます。

  • 要約は、conversationSummarizationSuggestion フィールドが入力された runtimeAnnotation として保存されます。
  • 会話の latestSummary フィールドが入力されます。

後続の分析では、新しいランタイム アノテーションが追加され、最新の要約が上書きされます。

{
  "name": "projects/694347961123/locations/us-east1/conversations/14849016801257151776",
  "createTime": "2023-03-07T23:00:00.243902Z",
  "updateTime": "2023-03-07T23:00:01.167050Z",
  …
  "runtimeAnnotations": [
    {
      "annotationId": "14849016801257150641",
      "createTime": "2023-03-07T23:00:01.167050Z",
      "conversationSummarizationSuggestion": {
        "text": "A summary of your conversation."
        "textSections": {
          "DEFAULT_SECTION": "A summary of your conversation."
        }
      }
    }
  ],
  "latestSummary": {
    "text": "A summary of your conversation."
    "textSections": {
      "DEFAULT_SECTION": "A summary of your conversation."
    }
  }
}

デフォルトで会話を要約する

分析を作成するたびに要約構成を指定するのではなく、プロジェクト設定でデフォルトのアノテーター セレクタを構成できます。設定した構成は、その分析に独自のアノテーター セレクタが含まれていない限り、すべての分析で使用されます。分析ごとに別途料金が発生します。

curl -X PATCH \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{analysis_config: {annotator_selector: {run_summarization_annotator: true}}}' \
  "https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/settings?updateMask=analysis_config"

Dialogflow ランタイムの統合

Dialogflow ランタイムの統合を有効にすると、Agent Assist で作成された要約を CX インサイトで表示することもできます。他の CX インサイトの要約と同様に、要約コンテンツはランタイム アノテーションとして、最新の要約フィールドで確認できます。

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/conversations/CONVERSATION_ID",
  "dataSource": {
    "dialogflowSource": {
      "dialogflowConversation": "projects/PROJECT_ID/locations/us/conversations/CONVERSATION_ID",
      "conversationDataItem": "projects/PROJECT_ID/locations/us/conversationDatasets/DATASET_ID/conversationDataItems/DATA_ITEM_ID"
    }
  },
  …
  "runtimeAnnotations": [
    {
      "annotationId": "projects/PROJECT_ID/locations/us/conversationDatasets/DATASET_ID/conversationDataItems/DATA_ITEM_ID/conversationAnnotations/ANNOTATION_ID",
      "createTime": "2023-03-20T19:49:01.929940Z",
      "startBoundary": {},
      "endBoundary": {
        "transcriptIndex": 1
      },
      "answerFeedback": {},
      "conversationSummarizationSuggestion": {
        "text": "The customer had a query about the service. Closed conversation prior to the resolution.",
        "textSections": {
          "DEFAULT_SECTION": "The customer had a query about the service. Closed conversation prior to the resolution."
        }
      }
    }
  ],
  "latestSummary": {
    "text": "The customer had a query about the service. Closed conversation prior to the resolution.",
    "textSections": {
      "DEFAULT_SECTION": "The customer had a query about the service. Closed conversation prior to the resolution."
    }
  }
}

要約コンテンツで会話をフィルタする

CX インサイトで会話を一覧表示するときに、要約コンテンツでフィルタできます。一般的な手順については、会話を一覧表示するをご覧ください。

CX インサイトでは、要約コンテンツに対して次のフィルタがサポートされています。

  • 要約あり: latest_summary:"*"
  • 要約なし: -latest_summary:"*"
  • フレーズを含む要約: latest_summary.text:"match this text"
  • フレーズを含まない要約: -latest_summary.text:"must not match this text"

BigQuery で要約を表示する

CX インサイトのデータを BigQuery にエクスポートすると、要約データもエクスポートされます。BigQuery エクスポートを構成する手順については、会話を BigQuery にエクスポートするをご覧ください。

各会話の最新の要約は、latest_summary フィールドで確認できます。

bq query --use_legacy_sql=false 'SELECT conversationName, latestSummary.text FROM DATASET.TABLE'

最新の要約と過去の要約を含むすべての要約は、文レベルのアノテーションとして使用できます。

bq query --use_legacy_sql=false <<EOF
SELECT
  conversationName,
  sen.sentence,
  JSON_QUERY(JSON_VALUE(ant.annotationRecord), '$.text') AS summary_text
FROM
  DATASET.TABLE,
  UNNEST(`sentences`) AS sen,
  UNNEST(`sen.annotations`) AS ant
WHERE ant.type = 'CONVERSATION_SUMMARIZATION_SUGGESTION'
EOF