요약을 사용하는 방법

요약은 사용자가 읽기에 너무 오래 걸리는 콘텐츠를 압축합니다. 이 서비스는 일반 텍스트, 대화 및 네이티브 문서라는 세 가지 유형의 장르에 대한 요약 솔루션을 제공합니다. 요약할 콘텐츠 형식과 일치하는 탭을 선택합니다.

텍스트 요약은 사용자가 읽기에 너무 오래 걸리는 콘텐츠를 줄입니다. 추출 및 추상 요약 모두 문서, 논문 또는 문서를 핵심 문장으로 압축합니다.

추출 요약은 원본 콘텐츠 내에서 가장 중요하거나 관련성 있는 정보를 집합적으로 나타내는 문장을 추출하여 요약을 생성합니다.

추상적 요약: 주요 아이디어를 캡처하는 문서에서 요약된 문장을 생성하여 요약을 생성합니다.

쿼리 중심 요약: 요약할 때 쿼리를 사용할 수 있습니다.

이러한 각 기능은 지정된 경우 관심 있는 특정 항목에 대해 요약할 수 있습니다.

이 서비스는 API에서 사용하는 AI 모델을 제공합니다. 분석을 위해 콘텐츠를 전송하기만 하면 됩니다.

더 쉽게 탐색할 수 있도록 각 서비스에 해당하는 섹션에 대한 링크는 다음과 같습니다.

Aspect 섹션
추출 추출 요약
추상화 추상 요약
쿼리에 초점을 맞춘 쿼리 중심 요약

Features

Tip

이러한 기능 사용을 시작하려면 빠른 시작 문서를 참조하세요. 코드를 작성할 필요 없이 Microsoft Foundry를 사용하여 예제 요청을 수행할 수도 있습니다.

추출 요약 API는 자연어 처리 기술을 사용하여 구조화되지 않은 텍스트 문서에서 핵심 문장을 찾습니다. 이러한 문장은 문서의 주요 개념을 전체적으로 전달합니다.

추출 요약은 원래 문서에서 추출된 문장 및 해당 위치와 함께 시스템 응답의 일부로 순위 점수를 반환합니다. 순위 점수는 문장이 문서의 주요 개념과 얼마나 관련이 있는지를 나타냅니다. 모델은 각 문장에 대해 0~1(포함) 사이의 점수를 제공하고 요청당 점수가 가장 높은 문장을 반환합니다. 예를 들어, 3개 문장 요약을 요청하는 경우 서비스는 점수가 가장 높은 3개 문장을 반환합니다.

Foundry Tools의 Azure Language에 있는 또 다른 기능인 핵심 구문 추출은 주요 정보를 추출할 수 있습니다. 핵심 구 추출과 추출 요약 중에서 결정할 때 다음 요소를 고려합니다.

  • 핵심 구 추출은 구를 반환하는 반면, 추출 요약은 문장을 반환합니다.
  • 추출 요약은 순위 점수와 함께 문장을 반환하며 요청당 상위 순위 문장이 반환됩니다.
  • 추출 요약은 다음 위치 정보도 반환합니다.
    • 오프셋: 추출된 각 문장의 시작 위치입니다.
    • 길이: 추출된 각 문장의 길이입니다.

데이터 처리 방법 결정(선택 사항)

데이터 제출

문서를 텍스트 문자열로 API에 제출합니다. API는 요청을 받으면 분석을 수행합니다. API는 비동기이므로 API 요청을 보내고 결과를 받는 사이에 지연이 있을 수 있습니다.

이 기능을 사용하면 요청이 수집된 시점부터 24시간 동안 API 결과를 사용할 수 있으며 응답은 이 가용성을 나타냅니다. 이 기간이 지나면 결과가 제거되고 더 이상 검색할 수 없습니다.

텍스트 요약 결과 가져오기

언어 감지에서 결과를 가져올 때 애플리케이션에 결과를 스트리밍하거나 로컬 시스템의 파일에 출력을 저장할 수 있습니다.

다음 예제에서는 요약을 위해 제출할 수 있는 콘텐츠를 보여줍니다. 콘텐츠는 Microsoft 블로그 문서 통합 AI에 대한 전체적인 표현에서 추출됩니다. 이 문서는 예제일 뿐입니다. API는 더 긴 입력 텍스트를 허용할 수 있습니다. 자세한 내용은 데이터 및 서비스 제한을참조하세요.

"Microsoft에서는 학습과 이해에 대해 보다 전체적이고 인간 중심적인 접근 방식을 취함으로써 기존 기술을 넘어 AI를 발전시키기 위한 노력을 기울이고 있습니다. Foundry Tools의 최고 기술 책임자로서 저는 놀라운 과학자 및 엔지니어 팀과 협력하여 이 탐구를 현실로 바꾸고 있습니다. 제 역할에서 저는 인간 인지의 세 가지 특성, 즉 단일 언어 텍스트(X), 청각 또는 시각 감각 신호(Y) 및 다국어(Z) 간의 관계를 보는 고유한 관점을 활용합니다. 세 가지가 모두 교차하는 지점에는 그림 1에 나와 있는 바와 같이 XYZ-코드라고 하는 매직이 있습니다. 인간보다 더 잘 말하고, 듣고, 보고, 이해할 수 있는 강력한 AI를 만드는 공동 표현입니다. XYZ-코드를 통해 장기적인 비전(도메인 간 전이 학습, 형식 및 언어 확장)을 수행할 수 있습니다. 목표는 오늘날 인간이 하는 것처럼 광범위한 다운스트림 AI 작업을 지원하기 위해 표현을 공동으로 학습할 수 있는 미리 학습된 모델을 보유하는 것입니다. 지난 5년 동안 우리는 대화형 음성 인식, 기계 번역, 대화형 질문 답변, 기계 읽기 이해 및 이미지 캡션 분야에서 벤치마크에서 인간의 성과를 달성했습니다. 이 다섯 가지 돌파구는 AI 기능의 도약을 위한 우리의 더 야심찬 포부에 대한 강력한 신호가 되었으며, 인간이 배우고 이해하는 방식에 더 가까운 다중 감각 및 다국어 학습을 달성하기 위한 방향을 제시했습니다. 저는 다운스트림 AI 작업에서 외부 기술 자료를 기반으로 한 경우에는 공동 XYZ- 코드가 이러한 열망의 기본 구성 요소라고 생각합니다."

텍스트 요약 API 요청은 API 백 엔드에 대한 작업을 만들어 요청을 수신하면 처리됩니다. 작업이 성공하면 API의 출력이 반환됩니다. 출력은 24시간 동안 검색에 사용할 수 있습니다. 이 시간이 지나면 출력이 제거됩니다. 다국어 지원 및 emoji 지원으로 인해 응답에 텍스트 오프셋이 포함될 수 있습니다. 자세한 내용은 오프셋을 처리하는 방법을참조하세요.

앞의 예제를 사용하는 경우 API는 다음과 같은 요약된 문장을 반환할 수 있습니다.

추출 요약:

  • "Microsoft 학습과 이해에 보다 전체적이고 인간 중심의 접근 방식을 취하여 기존 기술을 넘어 AI를 발전시키기 위한 탐구를 하고 있습니다."
  • "XYZ-코드를 통해 장기적인 비전(도메인 간 전이 학습, 형식 및 언어 확장)을 수행할 수 있습니다."
  • "목표는 오늘날 인간이 하는 것처럼 광범위한 다운스트림 AI 작업을 지원하기 위해 표현을 공동으로 학습할 수 있는 미리 학습된 모델을 보유하는 것입니다."

추상 요약:

  • "Microsoft는 학습 및 이해에 대해 보다 총체적이고 인간 중심적인 방식을 취하고 있습니다. XYZ-코드를 통해 장기적인 비전(도메인 간 전이 학습, 형식 및 언어 확장)을 수행할 수 있습니다. 지난 5년 동안 우리는 주요 벤치마크에서 인간의 성과를 달성했습니다."

텍스트 추출 요약 시도

텍스트 추출 요약을 사용하여 문서, 논문 또는 문서의 요약을 가져올 수 있습니다. 예를 보려면 빠른 시작 문서을 참조하세요.

sentenceCount 매개변수를 사용하여 반환할 문장 수를 지정하며, 기본값은 3입니다. 범위는 1~20 사이입니다.

매개 변수를 sortby 사용하여 추출된 문장이 반환 Offset 되는 순서를 지정하거나 Rank기본값으로 Offset 지정합니다.

매개 변수 값 Description
Rank 서비스에서 결정한 대로 입력 문서와의 관련성에 따라 문장을 정렬합니다.
Offset 입력 문서에 문장이 나타나는 원래 순서를 유지합니다.

텍스트 추상 요약 시도

다음 예제에서는 텍스트 추상화 요약을 시작하는 방법을 보여줍니다.

  1. 다음 명령을 텍스트 편집기에 복사합니다. BASH 예에서는 \ 줄 연속 문자를 사용합니다. 콘솔 또는 터미널에서 다른 줄 연속 문자를 사용하는 경우 해당 문자를 대신 사용하세요.
curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-text/jobs?api-version=2023-04-01 \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Text Abstractive Summarization Task Example",
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Foundry Tools, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there's magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code enables us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pretrained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks."
      }
    ]
  },
  "tasks": [
    {
      "kind": "AbstractiveSummarization",
      "taskName": "Text Abstractive Summarization Task 1",
    }
  ]
}
'
  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-text/jobs/12345678-1234-1234-1234-12345678?api-version=2022-10-01-preview
  1. 요청 결과를 가져오려면 다음 cURL 명령을 사용합니다. <my-job-id>을(를) 이전 operation-location 응답 헤더에서 받은 숫자 ID 값으로 반드시 교체해야 합니다.
curl -X GET https://<your-language-resource-endpoint>/language/analyze-text/jobs/<my-job-id>?api-version=2022-10-01-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>"

추상 텍스트 요약 예제 JSON 응답

{
    "jobId": "cd6418fe-db86-4350-aec1-f0d7c91442a6",
    "lastUpdateDateTime": "2022-09-08T16:45:14Z",
    "createdDateTime": "2022-09-08T16:44:53Z",
    "expirationDateTime": "2022-09-09T16:44:53Z",
    "status": "succeeded",
    "errors": [],
    "displayName": "Text Abstractive Summarization Task Example",
    "tasks": {
        "completed": 1,
        "failed": 0,
        "inProgress": 0,
        "total": 1,
        "items": [
            {
                "kind": "AbstractiveSummarizationLROResults",
                "taskName": "Text Abstractive Summarization Task 1",
                "lastUpdateDateTime": "2022-09-08T16:45:14.0717206Z",
                "status": "succeeded",
                "results": {
                    "documents": [
                        {
                            "summaries": [
                                {
                                    "text": "Microsoft is taking a more holistic, human-centric approach to AI. We've developed a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We've achieved human performance on benchmarks in conversational speech recognition, machine translation, ...... and image captions.",
                                    "contexts": [
                                        {
                                            "offset": 0,
                                            "length": 247
                                        }
                                    ]
                                }
                            ],
                            "id": "1"
                        }
                    ],
                    "errors": [],
                    "modelVersion": "latest"
                }
            }
        ]
    }
}
매개 변수 Description
-X POST <endpoint> API에 액세스하기 위한 엔드포인트를 지정합니다.
-H Content-Type: application/json JSON 데이터를 보내기 위한 콘텐츠 형식입니다.
-H "Ocp-Apim-Subscription-Key:<key> API에 액세스하기 위한 키를 지정합니다.
-d <documents> 보낼 문서가 포함된 JSON입니다.

다음 cURL 명령은 BASH 셸에서 실행됩니다. 사용자 고유의 리소스 이름, 리소스 키 및 JSON 값을 사용하여 이 명령을 편집합니다.

쿼리 기반 요약

쿼리 기반 텍스트 요약 API는 기존 텍스트 요약 API의 확장입니다.

가장 큰 차이점은 요청 본문(querytasks>parameters> 아래)의 새 query 필드입니다.

Tip

쿼리 기반 요약에는 사용 중인 쿼리 기반 요약 유형에 따라 길이 컨트롤의 사용률이 몇 가지 구별됩니다.

  • 쿼리 기반 추출 요약은 길이를 지정하여 길이 제어를 지원합니다 sentenceCount.
  • 쿼리 기반 추상적 요약은 길이 제어를 지원하지 않습니다.

예제 요청은 다음과 같습니다.

curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-text/jobs?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Text Extractive Summarization Task Example",
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Foundry Tools, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there's magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code enables us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pretrained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks."
      }
    ]
  },
"tasks": [
    {
      "kind": "AbstractiveSummarization",
      "taskName": "Query-based Abstractive Summarization",
      "parameters": {
          "query": "XYZ-code",
          "summaryLength": "short"
      }
    },    {
      "kind": "ExtractiveSummarization",
      "taskName": "Query_based Extractive Summarization",
      "parameters": {
          "query": "XYZ-code"
      }
    }
  ]
}
'

요약 길이 컨트롤

추출 요약에서 summaryLength 매개 변수 사용

summaryLength를 지정하지 않으면 모델이 요약 길이를 결정합니다.

summaryLength 매개 변수의 경우 다음 세 가지 값이 허용됩니다.

  • oneSentence: 약 80개의 토큰을 사용하여 대부분 하나의 문장에 대한 요약을 생성합니다.
  • short: 약 120개의 토큰을 사용하여 대부분 2~3개의 문장에 대한 요약을 생성합니다.
  • medium: 약 170개의 토큰을 사용하여 대부분 4~6개의 문장에 대한 요약을 생성합니다.
  • long: 토큰이 약 210개인 7개 이상의 문장에 대한 요약을 생성합니다.

예제 요청은 다음과 같습니다.

curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-text/jobs?api-version=2023-04-01 \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Text Abstractive Summarization Task Example",
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Foundry Tools, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there's magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code enables us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pretrained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks."
      }
    ]
  },
  "tasks": [
    {
      "kind": "AbstractiveSummarization",
      "taskName": "Length controlled Abstractive Summarization",
          "parameters": {
          "summaryLength": "short"
      }
    }
  ]
}
'

추출 요약에서 sentenceCount 매개 변수 사용

매개 변수의 sentenceCount 경우 1에서 20까지의 값을 입력하여 원하는 출력 문장 수를 나타냅니다.

예제 요청은 다음과 같습니다.

curl -i -X POST https://<your-language-resource-endpoint>/language/analyze-text/jobs?api-version=2023-11-15-preview \
-H "Content-Type: application/json" \
-H "Ocp-Apim-Subscription-Key: <your-language-resource-key>" \
-d \
' 
{
  "displayName": "Text Extractive Summarization Task Example",
  "analysisInput": {
    "documents": [
      {
        "id": "1",
        "language": "en",
        "text": "At Microsoft, we have been on a quest to advance AI beyond existing techniques, by taking a more holistic, human-centric approach to learning and understanding. As Chief Technology Officer of Foundry Tools, I have been working with a team of amazing scientists and engineers to turn this quest into a reality. In my role, I enjoy a unique perspective in viewing the relationship among three attributes of human cognition: monolingual text (X), audio or visual sensory signals, (Y) and multilingual (Z). At the intersection of all three, there's magic—what we call XYZ-code as illustrated in Figure 1—a joint representation to create more powerful AI that can speak, hear, see, and understand humans better. We believe XYZ-code enables us to fulfill our long-term vision: cross-domain transfer learning, spanning modalities and languages. The goal is to have pretrained models that can jointly learn representations to support a broad range of downstream AI tasks, much in the way humans do today. Over the past five years, we have achieved human performance on benchmarks in conversational speech recognition, machine translation, conversational question answering, machine reading comprehension, and image captioning. These five breakthroughs provided us with strong signals toward our more ambitious aspiration to produce a leap in AI capabilities, achieving multi-sensory and multilingual learning that is closer in line with how humans learn and understand. I believe the joint XYZ-code is a foundational component of this aspiration, if grounded with external knowledge sources in the downstream AI tasks."
      }
    ]
  },
"tasks": [
    {
      "kind": "ExtractiveSummarization",
      "taskName": "Length controlled Extractive Summarization",
      "parameters": {
          "sentenceCount": "5"
      }
    }
  ]
}
'

서비스 및 데이터 제한

분 및 초 단위로 보낼 수 있는 요청의 크기와 수에 대한 자세한 내용은 서비스 제한 문서를 참조하세요.

참고하십시오