会話要約の使い方

重要

プレビュー リージョンであるスウェーデン中部では、GPT モデルに基づいた最新かつ常に進化し続けている LLM の微調整の手法を確認できます。 スウェーデン中部リージョンの Langauge リソースを使用してそれらをぜひお試しください。

会話の概要作成は、以下を使用した場合にのみ利用可能です。

  • REST API
  • Python
  • C#

会話要約のアスペクト

  • チャプター タイトルと説明 (一般的な会話) は、会話をチャプター タイトルと会話の内容の要約にまとめるために設計されています。 この要約のアスペクトは、任意の数の関係者との会話で機能します。

  • 問題と解決 (コール センターに重点を置く) は、顧客と顧客サービス エージェントの間のテキスト チャット ログを要約するように設計されています。 この機能は、2 者間で発生するこれらのログに存在する問題と解決策の両方を提供できます。

  • 説明は、会話の説明を要約するように設計されています。

  • 要約は、長い会議や会話を簡潔な 1 段落の概要に集約して、簡単な概要を提供するように設計されています。

  • フォローアップ タスクは、会議中に発生する実施項目とタスクを要約するように設計されています。

A diagram for sending data to the conversation summarization issues and resolution feature.

API で使用される AI モデルはサービスによって提供されるため、分析対象のコンテンツを送信するだけで済みます。

簡単に移動できるように、各サービスの対応するセクションへのリンクを次に示します。

側面 セクション
問題と解決策 問題と解決策
チャプター タイトル チャプター タイトル
物語 説明
まとめとフォローアップ まとめとフォローアップ

機能

会話要約 API では、自然言語処理手法を使用して、要求ごとに会話を短い要約にまとめます。 会話要約は、2 者の会話で討議されている問題と解決策を要約したり、長い会話をチャプターと各チャプターの短い説明にまとめることができます。

Azure AI Language には、ドキュメント要約という名前の別の機能があり、こちらの方がドキュメントを簡潔な要約にまとめるのに適しています。 ドキュメント要約と会話要約のどちらを使うかを決める時には、次の点を考慮してください。

  • 入力形式: 会話要約は、話者とその発話を含むチャット テキストと音声トランスクリプトの両方で動作できます。 ドキュメント要約は、単純なテキスト、Word、PDF、または PowerPoint 形式を使用して動作します。
  • 要約の目的: たとえば、会話の問題と解決の要約は、顧客と顧客サービス エージェントの間のチャットの理由と解決を返します。

データの送信

Note

Language Studio を使用して送信する会話テキストの書式設定については、Language Studio に関する記事をご覧ください。

ドキュメントをテキストの文字列として API に送信します。 要求が受信されると分析が実行されます。 API は非同期なので、API 要求を送信してから結果を受信するまでに、遅延が発生する可能性があります。 1 分間および 1 秒間に送信できる要求のサイズと数については、以下のデータ制限をご覧ください。

この機能を使うと、API の結果は、応答で示される要求取り込み時刻から 24 時間利用できます。 この時間が経過すると、結果は消去され、取得できなくなります。

会話要約にデータを送信するときは、待機時間を短くするために、1 つの要求ごとに 1 つのチャット ログを送信することをお勧めします。

テキスト チャットから要約を取得する

会話の問題と解決の要約を使用して、必要に応じて要約を取得できます。 テキスト チャットの使用例については、クイックスタートの記事を参照してください。

音声の文字起こしから要約を取得する

会話の問題と解決の要約では、Speech サービスの音声テキスト変換機能を使用して、音声テキストから要約を取得することもできます。 次の例は、API 要求に含める可能性がある短い会話を示しています。

"conversations":[
   {
      "id":"abcdefgh-1234-1234-1234-1234abcdefgh",
      "language":"en",
      "modality":"transcript",
      "conversationItems":[
         {
            "modality":"transcript",
            "participantId":"speaker",
            "id":"12345678-abcd-efgh-1234-abcd123456",
            "content":{
               "text":"Hi.",
               "lexical":"hi",
               "itn":"hi",
               "maskedItn":"hi",
               "audioTimings":[
                  {
                     "word":"hi",
                     "offset":4500000,
                     "duration":2800000
                  }
               ]
            }
         }
      ]
   }
]

チャプター タイトルを取得する

会話のチャプター タイトルの要約を使用すると、入力会話からチャプター タイトルを取得できます。 ガイド付きのシナリオ例を次に示します。

  1. テキスト エディターに以下のコマンドをコピーします。 BASH の例では、行連結文字として \ を使用します。 ご利用のコンソールまたはターミナルで異なる行連結文字が使用されている場合は、その文字を使用してください。
curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-conversations/jobs?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Conversation Task Example",
  "analysisInput": {
    "conversations": [
      {
        "conversationItems": [
          {
            "text": "Hello, you’re chatting with Rene. How may I help you?",
            "id": "1",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "Hi, I tried to set up wifi connection for Smart Brew 300 espresso machine, but it didn’t work.",
            "id": "2",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "I’m sorry to hear that. Let’s see what we can do to fix this issue. Could you please try the following steps for me? First, could you push the wifi connection button, hold for 3 seconds, then let me know if the power light is slowly blinking on and off every second?",
            "id": "3",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "Yes, I pushed the wifi connection button, and now the power light is slowly blinking.",
            "id": "4",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "Great. Thank you! Now, please check in your Contoso Coffee app. Does it prompt to ask you to connect with the machine? ",
            "id": "5",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "No. Nothing happened.",
            "id": "6",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "I’m very sorry to hear that. Let me see if there’s another way to fix the issue. Please hold on for a minute.",
            "id": "7",
            "role": "Agent",
            "participantId": "Agent_1"
          }
        ],
        "modality": "text",
        "id": "conversation1",
        "language": "en"
      }
    ]
  },
  "tasks": [
    {
      "taskName": "Conversation Task 1",
      "kind": "ConversationalSummarizationTask",
      "parameters": {
        "summaryAspects": [
          "chapterTitle"
        ]
      }
    }
  ]
}
'
  1. 必要に応じて、コマンドに次の変更を加えます。

    • your-value-language-key 値をキーに置き換えます。
    • 要求 URL (your-language-resource-endpoint) の最初の部分を独自のエンドポイント URL に置き換えます。
  2. コマンド プロンプト ウィンドウ (BASH など) を開きます。

  3. テキスト エディターからコマンド プロンプト ウィンドウにコマンドを貼り付けて、コマンドを実行します。

  4. operation-location を応答ヘッダーから取得します。 値は次の URL のようになります。

https://<your-language-resource-endpoint>/language/analyze-conversations/jobs/12345678-1234-1234-1234-12345678?api-version=2023-11-15-preview
  1. 要求の結果を取得するには、次の cURL コマンドを使用します。 <my-job-id> を、前の operation-location 応答ヘッダーから受け取った GUID 値に必ず置き換えてください。
curl -X GET https://<your-language-resource-endpoint>/language/analyze-conversations/jobs/<my-job-id>?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>"

チャプター タイトルの要約 JSON 応答の例:

{
    "jobId": "b01af3b7-1870-460a-9e36-09af28d360a1",
    "lastUpdatedDateTime": "2023-11-15T18:24:26Z",
    "createdDateTime": "2023-11-15T18:24:23Z",
    "expirationDateTime": "2023-11-16T18:24:23Z",
    "status": "succeeded",
    "errors": [],
    "displayName": "Conversation Task Example",
    "tasks": {
        "completed": 1,
        "failed": 0,
        "inProgress": 0,
        "total": 1,
        "items": [
            {
                "kind": "conversationalSummarizationResults",
                "taskName": "Conversation Task 1",
                "lastUpdateDateTime": "2023-11-15T18:24:26.3433677Z",
                "status": "succeeded",
                "results": {
                    "conversations": [
                        {
                            "summaries": [
                                {
                                    "aspect": "chapterTitle",
                                    "text": "\"Discussing the Problem of Smart Blend 300 Espresso Machine's Wi-Fi Connectivity\"",
                                    "contexts": [
                                        {
                                            "conversationItemId": "1",
                                            "offset": 0,
                                            "length": 53
                                        },
                                        {
                                            "conversationItemId": "2",
                                            "offset": 0,
                                            "length": 94
                                        },
                                        {
                                            "conversationItemId": "3",
                                            "offset": 0,
                                            "length": 266
                                        },
                                        {
                                            "conversationItemId": "4",
                                            "offset": 0,
                                            "length": 85
                                        },
                                        {
                                            "conversationItemId": "5",
                                            "offset": 0,
                                            "length": 119
                                        },
                                        {
                                            "conversationItemId": "6",
                                            "offset": 0,
                                            "length": 21
                                        },
                                        {
                                            "conversationItemId": "7",
                                            "offset": 0,
                                            "length": 109
                                        }
                                    ]
                                }
                            ],
                            "id": "conversation1",
                            "warnings": []
                        }
                    ],
                    "errors": [],
                    "modelVersion": "latest"
                }
            }
        ]
    }
}

長い会話の場合、モデルはそれを複数のまとまりのある部分に分割し、各セグメントを要約します。 また、サマリーごとに長い contexts フィールドもあります。これは、サマリーを生成した入力会話の範囲を示します。

説明的な要約を取得する

会話要約では、入力された会話から説明的な要約を取得することもできます。 ガイド付きのシナリオ例を次に示します。

  1. テキスト エディターに以下のコマンドをコピーします。 BASH の例では、行連結文字として \ を使用します。 ご利用のコンソールまたはターミナルで異なる行連結文字が使用されている場合は、その文字を使用してください。
curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-conversations/jobs?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Conversation Task Example",
  "analysisInput": {
    "conversations": [
      {
        "conversationItems": [
          {
            "text": "Hello, you’re chatting with Rene. How may I help you?",
            "id": "1",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "Hi, I tried to set up wifi connection for Smart Brew 300 espresso machine, but it didn’t work.",
            "id": "2",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "I’m sorry to hear that. Let’s see what we can do to fix this issue. Could you please try the following steps for me? First, could you push the wifi connection button, hold for 3 seconds, then let me know if the power light is slowly blinking on and off every second?",
            "id": "3",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "Yes, I pushed the wifi connection button, and now the power light is slowly blinking.",
            "id": "4",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "Great. Thank you! Now, please check in your Contoso Coffee app. Does it prompt to ask you to connect with the machine? ",
            "id": "5",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "No. Nothing happened.",
            "id": "6",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "I’m very sorry to hear that. Let me see if there’s another way to fix the issue. Please hold on for a minute.",
            "id": "7",
            "role": "Agent",
            "participantId": "Agent_1"
          }
        ],
        "modality": "text",
        "id": "conversation1",
        "language": "en"
      }
    ]
  },
  "tasks": [
    {
      "taskName": "Conversation Task 1",
      "kind": "ConversationalSummarizationTask",
      "parameters": {
        "summaryAspects": [
          "narrative"
        ]
      }
    }
  ]
}
'
  1. 必要に応じて、コマンドに次の変更を加えます。

    • your-language-resource-key 値をキーに置き換えます。
    • 要求 URL (your-language-resource-endpoint) の最初の部分を独自のエンドポイント URL に置き換えます。
  2. コマンド プロンプト ウィンドウ (BASH など) を開きます。

  3. テキスト エディターからコマンド プロンプト ウィンドウにコマンドを貼り付けて、コマンドを実行します。

  4. operation-location を応答ヘッダーから取得します。 値は次の URL のようになります。

https://<your-language-resource-endpoint>/language/analyze-conversations/jobs/12345678-1234-1234-1234-12345678?api-version=2023-11-15-preview
  1. 要求の結果を取得するには、次の cURL コマンドを使用します。 <my-job-id> を、前の operation-location 応答ヘッダーから受け取った GUID 値に必ず置き換えてください。
curl -X GET https://<your-language-resource-endpoint>/language/analyze-conversations/jobs/<my-job-id>?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>"

説明的な要約の JSON 応答の例:

{
  "jobId": "d874a98c-bf31-4ac5-8b94-5c236f786754",
  "lastUpdatedDateTime": "2022-09-29T17:36:42Z",
  "createdDateTime": "2022-09-29T17:36:39Z",
  "expirationDateTime": "2022-09-30T17:36:39Z",
  "status": "succeeded",
  "errors": [],
  "displayName": "Conversation Task Example",
  "tasks": {
    "completed": 1,
    "failed": 0,
    "inProgress": 0,
    "total": 1,
    "items": [
      {
        "kind": "conversationalSummarizationResults",
        "taskName": "Conversation Task 1",
        "lastUpdateDateTime": "2022-09-29T17:36:42.895694Z",
        "status": "succeeded",
        "results": {
          "conversations": [
            {
              "summaries": [
                {
                  "aspect": "narrative",
                  "text": "Agent_1 helps customer to set up wifi connection for Smart Brew 300 espresso machine.",
                  "contexts": [
                    { "conversationItemId": "1", "offset": 0, "length": 53 },
                    { "conversationItemId": "2", "offset": 0, "length": 94 },
                    { "conversationItemId": "3", "offset": 0, "length": 266 },
                    { "conversationItemId": "4", "offset": 0, "length": 85 },
                    { "conversationItemId": "5", "offset": 0, "length": 119 },
                    { "conversationItemId": "6", "offset": 0, "length": 21 },
                    { "conversationItemId": "7", "offset": 0, "length": 109 }
                  ]
                }
              ],
              "id": "conversation1",
              "warnings": []
            }
          ],
          "errors": [],
          "modelVersion": "latest"
        }
      }
    ]
  }
}

長い会話の場合、モデルはそれを複数のまとまりのある部分に分割し、各セグメントを要約します。 また、サマリーごとに長い contexts フィールドもあります。これは、サマリーを生成した入力会話の範囲を示します。

要約とフォローアップ タスクの概要を取得する

会話要約では、入力された会話から要約とフォローアップ タスクを取得することもできます。 ガイド付きのシナリオ例を次に示します。

  1. テキスト エディターに以下のコマンドをコピーします。 BASH の例では、行連結文字として \ を使用します。 ご利用のコンソールまたはターミナルで異なる行連結文字が使用されている場合は、その文字を使用してください。
curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-conversations/jobs?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Conversation Task Example",
  "analysisInput": {
    "conversations": [
      {
        "conversationItems": [
          {
            "text": "Hello, you’re chatting with Rene. How may I help you?",
            "id": "1",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "Hi, I tried to set up wifi connection for Smart Brew 300 espresso machine, but it didn’t work.",
            "id": "2",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "I’m sorry to hear that. Let’s see what we can do to fix this issue. Could you please try the following steps for me? First, could you push the wifi connection button, hold for 3 seconds, then let me know if the power light is slowly blinking on and off every second?",
            "id": "3",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "Yes, I pushed the wifi connection button, and now the power light is slowly blinking.",
            "id": "4",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "Great. Thank you! Now, please check in your Contoso Coffee app. Does it prompt to ask you to connect with the machine? ",
            "id": "5",
            "role": "Agent",
            "participantId": "Agent_1"
          },
          {
            "text": "No. Nothing happened.",
            "id": "6",
            "role": "Customer",
            "participantId": "Customer_1"
          },
          {
            "text": "I’m very sorry to hear that. Let me see if there’s another way to fix the issue. Please hold on for a minute.",
            "id": "7",
            "role": "Agent",
            "participantId": "Agent_1"
          }
        ],
        "modality": "text",
        "id": "conversation1",
        "language": "en"
      }
    ]
  },
  "tasks": [
    {
      "taskName": "Conversation Task 1",
      "kind": "ConversationalSummarizationTask",
      "parameters": {
        "summaryAspects": [
          "recap",
          "follow-up tasks"
        ]
      }
    }
  ]
}
'
  1. 必要に応じて、コマンドに次の変更を加えます。

    • your-language-resource-key 値をキーに置き換えます。
    • 要求 URL (your-language-resource-endpoint) の最初の部分を独自のエンドポイント URL に置き換えます。
  2. コマンド プロンプト ウィンドウ (BASH など) を開きます。

  3. テキスト エディターからコマンド プロンプト ウィンドウにコマンドを貼り付けて、コマンドを実行します。

  4. operation-location を応答ヘッダーから取得します。 値は次の URL のようになります。

https://<your-language-resource-endpoint>/language/analyze-conversations/jobs/12345678-1234-1234-1234-12345678?api-version=2023-11-15-preview
  1. 要求の結果を取得するには、次の cURL コマンドを使用します。 <my-job-id> を、前の operation-location 応答ヘッダーから受け取った GUID 値に必ず置き換えてください。
curl -X GET https://<your-language-resource-endpoint>/language/analyze-conversations/jobs/<my-job-id>?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>"

要約とフォローアップの概要作成 JSON 応答の例:

{
    "jobId": "e585d097-c19a-466e-8f99-a9646e55b1f5",
    "lastUpdatedDateTime": "2023-11-15T18:19:56Z",
    "createdDateTime": "2023-11-15T18:19:53Z",
    "expirationDateTime": "2023-11-16T18:19:53Z",
    "status": "succeeded",
    "errors": [],
    "displayName": "Conversation Task Example",
    "tasks": {
        "completed": 1,
        "failed": 0,
        "inProgress": 0,
        "total": 1,
        "items": [
            {
                "kind": "conversationalSummarizationResults",
                "taskName": "Conversation Task 1",
                "lastUpdateDateTime": "2023-11-15T18:19:56.1801785Z",
                "status": "succeeded",
                "results": {
                    "conversations": [
                        {
                            "summaries": [
                                {
                                    "aspect": "recap",
                                    "text": "The customer contacted the service agent, Rene, regarding an issue with setting up a wifi connection for their Smart Brew 300 espresso machine. The agent guided the customer through several steps, including pushing the wifi connection button and checking if the power light was blinking. However, the customer reported that no prompts were received in the Contoso Coffee app to connect with the machine. The agent then decided to look for another solution.",
                                    "contexts": [
                                        {
                                            "conversationItemId": "1",
                                            "offset": 0,
                                            "length": 53
                                        },
                                        {
                                            "conversationItemId": "2",
                                            "offset": 0,
                                            "length": 94
                                        },
                                        {
                                            "conversationItemId": "3",
                                            "offset": 0,
                                            "length": 266
                                        },
                                        {
                                            "conversationItemId": "4",
                                            "offset": 0,
                                            "length": 85
                                        },
                                        {
                                            "conversationItemId": "5",
                                            "offset": 0,
                                            "length": 119
                                        },
                                        {
                                            "conversationItemId": "6",
                                            "offset": 0,
                                            "length": 21
                                        },
                                        {
                                            "conversationItemId": "7",
                                            "offset": 0,
                                            "length": 109
                                        }
                                    ]
                                },
                                {
                                    "aspect": "Follow-Up Tasks",
                                    "text": "@Agent_1 will ask the customer to push the wifi connection button, hold for 3 seconds, then check if the power light is slowly blinking on and off every second."
                                },
                                {
                                    "aspect": "Follow-Up Tasks",
                                    "text": "@Agent_1 will ask the customer to check in the Contoso Coffee app if it prompts to connect with the machine."
                                },
                                {
                                    "aspect": "Follow-Up Tasks",
                                    "text": "@Agent_1 will investigate another way to fix the issue."
                                }
                            ],
                            "id": "conversation1",
                            "warnings": []
                        }
                    ],
                    "errors": [],
                    "modelVersion": "latest"
                }
            }
        ]
    }
}

長い会話の場合、モデルはそれを複数のまとまりのある部分に分割し、各セグメントを要約します。 また、サマリーごとに長い contexts フィールドもあります。これは、サマリーを生成した入力会話の範囲を示します。

会話の問題と解決の要約結果の取得

次のテキストは、会話の問題と解決の要約のために送信するコンテンツの例です。 これは一例に過ぎず、API はこれより長い入力テキストを受け入れることができます。 詳しくは、データの制限に関する記事をご覧ください。

エージェント: "どのような御用でしょうか?"

顧客: "Contoso サブスクリプションをアップグレードするにはどうすればよいのでしょうか? 一日中試しているのですが。"

エージェント: "アップグレード ボタンを押した後に、サインインして指示に従ってください。"

抽出要約 API は、API バックエンド用のジョブを作成することにより、要求を受信した時点で実行されます。 ジョブが成功すると、API の出力が返されます。 出力は 24 時間取得できます。 この時間が過ぎると、出力は消去されます。 多言語と絵文字のサポートにより、応答にはテキスト オフセットが含まれる場合があります。 詳細についてはオフセットの処理方法に関するページを参照してください。

上記の例では、API から次のような要約された文が返される可能性があります。

要約されたテキスト 側面
「お客様はサブスクリプションをアップグレードしたいと考えています。 お客様はその方法を知りません。」 イシュー
「お客様はアップグレード ボタンを押してサインインする必要があります。」 解決

関連項目