빠른 시작: 통화 후 대화 내용 기록 및 분석

Language Service 설명서 | Language Studio | Speech Service 설명서 | Speech Studio

이 C# 빠른 시작에서는 콜 센터 대화 내용 기록에 대한 감정 분석 및 대화 요약을 수행합니다. 샘플은 중요한 정보를 자동으로 식별, 분류 및 수정합니다. 빠른 시작은 Azure Cognitive SpeechAzure Cognitive Language 서비스의 기능을 사용하는 서비스 간 시나리오를 구현합니다.

Language 및 Speech Service를 사용하여 콜센터 대화를 분석하는 방법에 대한 데모를 보려면 Language Studio 또는 Speech Studio를 사용해 보세요.

코드 없는 접근 방식을 사용하여 콜 센터 대화 내용 기록 솔루션을 Azure에 배포하려면 수집 클라이언트를 사용해 보세요.

빠른 시작에서는 다음과 같은 음성용 Azure AI 서비스 기능이 사용됩니다.

  • 일괄 처리 기록: 대화 내용 기록을 위해 오디오 파일의 일괄 처리를 제출합니다.
  • 화자 분리: 모노 16khz 16비트 PCM wav 파일의 분할을 통해 여러 화자를 분리합니다.

Language Service는 다음과 같은 기능을 제공합니다.

  • PII(개인 식별 정보) 추출 및 수정: 대화 기록에서 중요한 정보를 식별, 분류 및 수정합니다.
  • 대화 요약: 각 대화 참가자가 문제 및 해결 방법에 대해 말한 내용을 추상적인 텍스트로 요약합니다. 예를 들어 콜 센터는 양이 많은 제품 문제를 그룹화할 수 있습니다.
  • 감정 분석 및 오피니언 마이닝: 대화 내용 기록을 분석하고, 긍정적, 중립적 또는 부정적 감정을 발화 및 대화 수준에서 연결합니다.

필수 조건

Important

이 빠른 시작에서는 대화 요약에 액세스해야 합니다. 액세스하려면 온라인 요청을 제출하고 승인을 받아야 합니다.

이 빠른 시작의 --languageKey--languageEndpoint 값은 대화 요약 API: eastus, northeuropeuksouth에서 지원하는 지역 중 하나에 있는 리소스에 해당해야 합니다.

C#을 사용하여 통화 후 대화 내용 기록 분석 실행

이러한 단계에 따라 통화 후 대화 내용 기록 분석 빠른 시작 코드 예제를 빌드하고 실행합니다.

  1. GitHub에서 scenarios/csharp/dotnetcore/call-center/ 샘플 파일을 복사합니다. Git이 설치되어 있으면 명령 프롬프트를 열고, git clone 명령을 실행하여 Speech SDK 샘플 리포지토리를 다운로드합니다.

    git clone https://github.com/Azure-Samples/cognitive-services-speech-sdk.git
    
  2. 명령 프롬프트를 열고, 프로젝트 디렉터리로 변경합니다.

    cd <your-local-path>/scenarios/csharp/dotnetcore/call-center/call-center/
    
  3. .NET CLI를 사용하여 프로젝트를 빌드합니다.

    dotnet build
    
  4. 기본 설정 명령줄 인수를 사용하여 애플리케이션을 실행합니다. 사용 가능한 옵션은 사용법 및 인수를 참조하세요.

    다음은 GitHub의 예제 오디오 파일의 대화 내용을 기록하는 예제입니다.

    dotnet run --languageKey YourResourceKey --languageEndpoint YourResourceEndpoint --speechKey YourResourceKey --speechRegion YourResourceRegion --input "https://github.com/Azure-Samples/cognitive-services-speech-sdk/raw/master/scenarios/call-center/sampledata/Call1_separated_16k_health_insurance.wav" --stereo  --output summary.json
    

    입력에 대한 대화 내용 기록이 이미 있는 경우 언어 리소스만 필요한 예제는 다음과 같습니다.

    dotnet run --languageKey YourResourceKey --languageEndpoint YourResourceEndpoint --jsonInput "YourTranscriptionFile.json" --stereo  --output summary.json
    

    YourResourceKey을 Azure AI 서비스 리소스 키로 바꾸고, YourResourceRegion를 Azure AI 서비스 리소스 지역(예: eastus)으로 바꾸고, YourResourceEndpoint을 Azure AI 서비스 엔드포인트로 바꿉니다. --input--output으로 지정한 경로가 유효한지 확인합니다. 그렇지 않으면 경로를 변경해야 합니다.

    Important

    완료되면 코드에서 키를 제거하고 공개적으로 게시하지 마세요. 프로덕션의 경우 Azure Key Vault와 같은 자격 증명을 안전하게 저장하고 액세스하는 방법을 사용합니다. 자세한 내용은 Azure AI 서비스 보안 문서를 참조하세요.

결과 확인

콘솔 출력에는 전체 대화 및 요약이 표시됩니다. 다음은 간결성을 위해 수정된 전체 요약의 예제입니다.

Conversation summary:
    issue: Customer wants to sign up for insurance.
    resolution: Customer was advised that customer would be contacted by the insurance company.

--output FILE 선택적 인수를 지정하면 결과의 JSON 버전이 파일에 기록됩니다. 파일 출력은 일괄 처리 기록(음성), 감정(언어) 및 대화 요약(언어) API의 JSON 응답 조합입니다.

transcription 속성에는 일괄 처리 기록과 병합된 감정 분석 결과가 포함된 JSON 개체가 포함됩니다. 다음은 간결성을 위해 수정된 예제입니다.

{
    "source": "https://github.com/Azure-Samples/cognitive-services-speech-sdk/raw/master/scenarios/call-center/sampledata/Call1_separated_16k_health_insurance.wav",
// Example results redacted for brevity
        "nBest": [
          {
            "confidence": 0.77464247,
            "lexical": "hello thank you for calling contoso who am i speaking with today",
            "itn": "hello thank you for calling contoso who am i speaking with today",
            "maskedITN": "hello thank you for calling contoso who am i speaking with today",
            "display": "Hello, thank you for calling Contoso. Who am I speaking with today?",
            "sentiment": {
              "positive": 0.78,
              "neutral": 0.21,
              "negative": 0.01
            }
          },
        ]
// Example results redacted for brevity
}   

conversationAnalyticsResults 속성에는 대화 PII 및 대화 요약 분석 결과가 포함된 JSON 개체가 포함됩니다. 다음은 간결성을 위해 수정된 예제입니다.

{
  "conversationAnalyticsResults": {
    "conversationSummaryResults": {
      "conversations": [
        {
          "id": "conversation1",
          "summaries": [
            {
              "aspect": "issue",
              "text": "Customer wants to sign up for insurance"
            },
            {
              "aspect": "resolution",
              "text": "Customer was advised that customer would be contacted by the insurance company"
            }
          ],
          "warnings": []
        }
      ],
      "errors": [],
      "modelVersion": "2022-05-15-preview"
    },
    "conversationPiiResults": {
      "combinedRedactedContent": [
        {
          "channel": "0",
          "display": "Hello, thank you for calling Contoso. Who am I speaking with today? Hi, ****. Uh, are you calling because you need health insurance?", // Example results redacted for brevity
          "itn": "hello thank you for calling contoso who am i speaking with today hi **** uh are you calling because you need health insurance", // Example results redacted for brevity
          "lexical": "hello thank you for calling contoso who am i speaking with today hi **** uh are you calling because you need health insurance" // Example results redacted for brevity
        },
        {
          "channel": "1",
          "display": "Hi, my name is **********. I'm trying to enroll myself with Contoso. Yes. Yeah, I'm calling to sign up for insurance.", // Example results redacted for brevity
          "itn": "hi my name is ********** i'm trying to enroll myself with contoso yes yeah i'm calling to sign up for insurance", // Example results redacted for brevity
          "lexical": "hi my name is ********** i'm trying to enroll myself with contoso yes yeah i'm calling to sign up for insurance" // Example results redacted for brevity
        }
      ],
      "conversations": [
        {
          "id": "conversation1",
          "conversationItems": [
            {
              "id": "0",
              "redactedContent": {
                "itn": "hello thank you for calling contoso who am i speaking with today",
                "lexical": "hello thank you for calling contoso who am i speaking with today",
                "text": "Hello, thank you for calling Contoso. Who am I speaking with today?"
              },
              "entities": [],
              "channel": "0",
              "offset": "PT0.77S"
            },
            {
              "id": "1",
              "redactedContent": {
                "itn": "hi my name is ********** i'm trying to enroll myself with contoso",
                "lexical": "hi my name is ********** i'm trying to enroll myself with contoso",
                "text": "Hi, my name is **********. I'm trying to enroll myself with Contoso."
              },
              "entities": [
                {
                  "text": "Mary Rondo",
                  "category": "Name",
                  "offset": 15,
                  "length": 10,
                  "confidenceScore": 0.97
                }
              ],
              "channel": "1",
              "offset": "PT4.55S"
            },
            {
              "id": "2",
              "redactedContent": {
                "itn": "hi **** uh are you calling because you need health insurance",
                "lexical": "hi **** uh are you calling because you need health insurance",
                "text": "Hi, ****. Uh, are you calling because you need health insurance?"
              },
              "entities": [
                {
                  "text": "Mary",
                  "category": "Name",
                  "offset": 4,
                  "length": 4,
                  "confidenceScore": 0.93
                }
              ],
              "channel": "0",
              "offset": "PT9.55S"
            },
            {
              "id": "3",
              "redactedContent": {
                "itn": "yes yeah i'm calling to sign up for insurance",
                "lexical": "yes yeah i'm calling to sign up for insurance",
                "text": "Yes. Yeah, I'm calling to sign up for insurance."
              },
              "entities": [],
              "channel": "1",
              "offset": "PT13.09S"
            },
// Example results redacted for brevity
          ],
          "warnings": []
        }
      ]
    }
  }
}

사용법 및 인수

사용법: call-center -- [...]

Important

다중 서비스 리소스 또는 별도 언어음성 리소스를 사용할 수 있습니다. 두 경우 모두 --languageKey--languageEndpoint 값은 대화 요약 API: eastus, northeuropeuksouth에서 지원하는 지역 중 하나에 있는 리소스에 해당해야 합니다.

연결 옵션은 다음과 같습니다.

  • --speechKey KEY: Azure AI 서비스 또는 음성 리소스 키. URL 옵션에서 --input을 사용하는 오디오 대화 내용 기록에 필요합니다.

  • --speechRegion REGION: Azure AI 서비스 또는 음성 리소스 지역. URL 옵션에서 --input을 사용하는 오디오 대화 내용 기록에 필요합니다. 예제: eastus, northeurope

  • --languageKey KEY: Azure AI 서비스 또는 언어 리소스 키. 필수입니다.

  • --languageEndpoint ENDPOINT: Azure AI 서비스 또는 언어 리소스 엔드포인트. 필수입니다. 예: https://YourResourceName.cognitiveservices.azure.com

입력 옵션은 다음과 같습니다.

  • --input URL: URL의 입력 오디오입니다. --input 또는 --jsonInput 옵션 중 하나를 설정해야 합니다.
  • --jsonInput FILE: FILE에서 기존 일괄 처리 기록 JSON 결과를 입력합니다. 이 옵션을 사용하면 이미 있는 대화 내용 기록을 처리하는 데 언어 리소스만 필요합니다. 이 옵션을 사용하면 오디오 파일이나 음성 리소스는 필요하지 않습니다. --input를 재정의합니다. --input 또는 --jsonInput 옵션 중 하나를 설정해야 합니다.
  • --stereo: '''입력 URL'을 통한 오디오가 스테레오 형식이어야 했음을 나타냅니다. 스테레오를 지정하지 않으면 모노 16khz 16비트 PCM wav 파일이 가정됩니다. 모노 파일의 분할은 여러 화자를 분리하는 데 사용됩니다. 2 채널 스테레오 파일에는 이미 채널당 하나의 화자가 있어야 하므로 스테레오 파일의 분할은 지원되지 않습니다.
  • --certificate: PEM 인증서 파일입니다. C++에 필요합니다.

언어 옵션은 다음과 같습니다.

  • --language LANGUAGE: 감정 분석 및 대화 분석에 사용할 언어입니다. 이 값은 두 문자 ISO 639-1 코드여야 합니다. 기본값은 en입니다.
  • --locale LOCALE: 오디오의 일괄 처리 기록에 사용할 로캘입니다. 기본값은 en-US입니다.

출력 옵션은 다음과 같습니다.

  • --help: 사용 도움말을 표시하고 중지합니다.
  • --output FILE: 대화 내용 기록, 감정, 대화 PII 및 대화 요약을 JSON 형식으로 텍스트 파일에 출력합니다. 자세한 내용은 출력 예제를 참조하세요.

리소스 정리

Azure portal 또는 Azure 명령줄 인터페이스(CLI)를 사용하여 생성한 Azure AI 서비스 리소스를 제거할 수 있습니다.

다음 단계