Share via


Document Models - Analyze Document

문서 모델을 사용하여 문서를 분석합니다.

POST {endpoint}/documentintelligence/documentModels/{modelId}:analyze?_overload=analyzeDocument&api-version=2024-02-29-preview
POST {endpoint}/documentintelligence/documentModels/{modelId}:analyze?_overload=analyzeDocument&api-version=2024-02-29-preview&pages={pages}&locale={locale}&stringIndexType={stringIndexType}&features={features}&queryFields={queryFields}&outputContentFormat={outputContentFormat}

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
endpoint
path True

string

Document Intelligence 서비스 엔드포인트입니다.

modelId
path True

string

고유한 문서 모델 이름입니다.

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$

api-version
query True

string

이 작업에 사용할 API 버전입니다.

features
query

DocumentAnalysisFeature[]

선택적 분석 기능 목록입니다.

locale
query

string

텍스트 인식 및 문서 분석에 대한 로캘 힌트입니다. 값에는 언어 코드(예: "en", "fr") 또는 BCP 47 언어 태그(예: "en-US")만 포함될 수 있습니다.

outputContentFormat
query

ContentFormat

분석 결과 최상위 콘텐츠의 형식입니다.

pages
query

string

분석할 1 기반 페이지 번호 목록입니다. 예: "1-3,5,7-9"

Regex pattern: ^(\d+(-\d+)?)(,\s*(\d+(-\d+)?))*$

queryFields
query

string[]

추출할 추가 필드 목록입니다. 예: "NumberOfGuests,StoreNumber"

stringIndexType
query

StringIndexType

문자열 오프셋 및 길이를 계산하는 데 사용되는 메서드입니다.

요청 본문

Name 형식 Description
base64Source

string

분석할 문서의 Base64 인코딩입니다. urlSource 또는 base64Source를 지정해야 합니다.

urlSource

string

분석할 문서 URL입니다. urlSource 또는 base64Source를 지정해야 합니다.

응답

Name 형식 Description
202 Accepted

처리를 위해 요청이 수락되었지만 처리가 아직 완료되지 않았습니다.

Headers

  • Operation-Location: string
  • Retry-After: integer
Other Status Codes

ErrorResponse

예기치 않은 오류 응답입니다.

보안

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

OAuth2Auth

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

예제

Analyze Document from Base64
Analyze Document from Url

Analyze Document from Base64

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/prebuilt-layout:analyze?_overload=analyzeDocument&api-version=2024-02-29-preview&pages=1-2,4&locale=en-US&stringIndexType=textElements

{
  "base64Source": "e2Jhc2U2NEVuY29kZWRQZGZ9"
}

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/prebuilt-layout/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-02-29-preview

Analyze Document from Url

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel:analyze?_overload=analyzeDocument&api-version=2024-02-29-preview&pages=1-2,4&locale=en-US&stringIndexType=textElements

{
  "urlSource": "http://host.com/doc.pdf"
}

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-02-29-preview

정의

Name Description
AnalyzeDocumentRequest

문서 분석 매개 변수입니다.

ContentFormat

분석된 결과의 콘텐츠 형식입니다.

DocumentAnalysisFeature

선택적 분석 기능 목록입니다.

Error

Error 개체.

ErrorResponse

오류 응답 개체입니다.

InnerError

오류에 대한 보다 구체적인 정보를 포함하는 개체입니다.

StringIndexType

문자열 오프셋 및 길이를 계산하는 데 사용되는 메서드입니다.

AnalyzeDocumentRequest

문서 분석 매개 변수입니다.

Name 형식 Description
base64Source

string

분석할 문서의 Base64 인코딩입니다. urlSource 또는 base64Source를 지정해야 합니다.

urlSource

string

분석할 문서 URL입니다. urlSource 또는 base64Source를 지정해야 합니다.

ContentFormat

분석된 결과의 콘텐츠 형식입니다.

Name 형식 Description
markdown

string

섹션 제목, 테이블 등을 사용하여 문서 콘텐츠의 Markdown 표현

text

string

서식이 없는 문서 콘텐츠의 일반 텍스트 표현입니다.

DocumentAnalysisFeature

선택적 분석 기능 목록입니다.

Name 형식 Description
barcodes

string

문서에서 바코드 검색을 사용하도록 설정합니다.

formulas

string

문서에서 수학 식 검색을 사용하도록 설정합니다.

keyValuePairs

string

문서에서 일반 키 값 쌍(양식 필드)을 검색할 수 있습니다.

languages

string

텍스트 콘텐츠 언어의 검색을 사용하도록 설정합니다.

ocrHighResolution

string

더 높은 해상도로 OCR을 수행하여 세밀한 인쇄로 문서를 처리합니다.

queryFields

string

queryFields 쿼리 매개 변수를 통해 추가 필드 추출을 사용하도록 설정합니다.

styleFont

string

다양한 글꼴 스타일을 인식할 수 있습니다.

Error

Error 개체.

Name 형식 Description
code

string

서버 정의 오류 코드 집합 중 하나입니다.

details

Error[]

이 보고된 오류로 이어진 특정 오류에 대한 세부 정보 배열입니다.

innererror

InnerError

오류에 대한 현재 개체보다 더 구체적인 정보를 포함하는 개체입니다.

message

string

사람이 읽을 수 있는 오류 표현입니다.

target

string

오류의 대상입니다.

ErrorResponse

오류 응답 개체입니다.

Name 형식 Description
error

Error

오류 정보입니다.

InnerError

오류에 대한 보다 구체적인 정보를 포함하는 개체입니다.

Name 형식 Description
code

string

서버 정의 오류 코드 집합 중 하나입니다.

innererror

InnerError

내부 오류입니다.

message

string

사람이 읽을 수 있는 오류 표현입니다.

StringIndexType

문자열 오프셋 및 길이를 계산하는 데 사용되는 메서드입니다.

Name 형식 Description
textElements

string

유니코드 8.0.0에 정의된 사용자 인식 표시 문자 또는 그래프 클러스터입니다.

unicodeCodePoint

string

단일 유니코드 코드 포인트로 표시되는 문자 단위입니다. Python 3에서 사용됩니다.

utf16CodeUnit

string

16비트 유니코드 코드 단위로 표시되는 문자 단위입니다. JavaScript, Java 및 .NET에서 사용됩니다.