共用方式為


如何使用交談摘要

重要

我們的預覽區域 (瑞典中部) 展示我們以 GPT 模型為基礎、最新且不斷進化的 LLM 微調技術。 歡迎在瑞典中部區域透過語言資源進行試用。

對話摘要只能使用:

  • REST API
  • Python
  • C#

交談摘要層面

  • 章節標題和敘述 (一般交談) 的設計目的是將交談摘要成章節標題,以及摘要交談的內容。 此摘要層面適用於和交談方 (數量不限) 的交談。

  • 問題和解決方法 (以客服中心為主) 的設計目的是摘要說明客戶與客戶服務專員之間的文字聊天記錄。 這項功能可以提供這些記錄所呈現的問題和解決方法 (於雙方之間發生)。

  • 記述的設計目的是要摘要交談的記述。

  • 回顧旨在將冗長的會議或交談濃縮成為一段簡潔的摘要,以提供快速概觀。

  • 後續工作旨在總結會議期間出現的動作項目和工作。

此圖表顯示將資料傳送至交談摘要問題和解決方法功能。

API 所使用的 AI 模型由服務所提供,您只需要傳送要分析的內容即可。

為了方便瀏覽,以下是每個服務對應區段的連結:

層面 區段​​
問題和解決方案 問題和解決方案
章節標題 章節標題
記述 記述
回顧和後續追蹤 回顧和後續追蹤

功能

交談摘要 API 會使用自然語言處理技術,並根據要求將交談摘要成較短的摘要。 交談摘要可以摘要說明兩方交談中所討論的問題和解決方法,或是將冗長對話摘要成章節以及各章節的簡短敘述。

Azure AI 語言中名為文字摘要的另一項功能,更適合將文件摘要成簡潔摘要。 在決定是要使用文字摘要還是交談摘要時,請考慮以下幾點:

  • 輸入格式:交談摘要可以用於聊天文字,也可用於有說話者及其談話的語音文字記錄。 文字摘要會使用簡單文字、Word、PDF 或 PowerPoint 格式運作。
  • 摘要目的:例如,交談問題和解決方法摘要會傳回原因,以及客戶與客戶服務專員之間聊天的解決方法。

提交資料

注意

如需使用 Language Studio 格式化交談文字以提交的資訊,請參閱 Language Studio 一文。

您會以文字字串形式將文件提交至 API。 分析會在接收要求時執行。 因為 API 為非同步,所以傳送 API 要求與接收結果之間可能會有延遲。 如需您每分鐘和每秒鐘可以傳送的要求大小和數量資訊,請參閱下列資料限制一節。

當您使用這項功能時,API 結果可從要求內嵌的時間起 24 小時內提供使用,且會在回應中指出。 在這段時間之後,結果將會予以清除,且無法再供擷取。

當您將資料提交至交談摘要時,建議您每個要求傳送一個聊天記錄,以縮短延遲時間。

從文字聊天取得摘要

您可以視需要使用交談問題和解決方法摘要來取得摘要。 若要查看使用文字聊天的範例,請參閱快速入門文章

從語音謄寫取得摘要

對話問題和解決方法摘要也可讓您使用語音服務的語音轉換文字功能,從語音文字記錄取得摘要。 下列範例顯示您可能包含在 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 的輸出。 輸出將可供擷取 24 小時。 在這段時間之後,就會清除輸出。 由於多語系和表情符號的支援,回應可能會包含文字位移。 如需詳細資訊,請參閱如何處理位移

在上述範例中,API 可能會傳回下列摘要句子:

文字摘要 層面
「客戶想要升級其訂用帳戶。 客戶不知道如何執行。」 問題
「客戶必須按升級按鈕並登入。」 解析

另請參閱