다음을 통해 공유


Document Models - Analyze Document

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

POST {endpoint}/formrecognizer/documentModels/{modelId}:analyze?api-version=2023-07-31
POST {endpoint}/formrecognizer/documentModels/{modelId}:analyze?pages={pages}&locale={locale}&stringIndexType={stringIndexType}&api-version=2023-07-31&features={features}

URI 매개 변수

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

string

url

지원되는 Cognitive Services 엔드포인트(프로토콜 및 호스트 이름( 예: https://westus2.api.cognitive.microsoft.com).

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")만 포함될 수 있습니다.

pages
query

string

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

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

stringIndexType
query

StringIndexType

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

요청 헤더

Media Types: "application/json", "application/octet-stream", "application/pdf", "image/jpeg", "image/png", "image/tiff", "image/bmp", "image/heif", "text/html", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.presentationml.presentation"

Name 필수 형식 Description
Ocp-Apim-Subscription-Key True

string

Azure Cognitive Services 구독의 비밀 키입니다.

요청 본문

Media Types: "application/json", "application/octet-stream", "application/pdf", "image/jpeg", "image/png", "image/tiff", "image/bmp", "image/heif", "text/html", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.presentationml.presentation"

Name 형식 Description
base64Source

string

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

urlSource

string

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

응답

Name 형식 Description
202 Accepted

요청이 성공적으로 큐에 대기됩니다.

Headers

Operation-Location: string

Other Status Codes

ErrorResponse

오류가 발생했습니다.

보안

Ocp-Apim-Subscription-Key

Azure Cognitive Services 구독의 비밀 키입니다.

Type: apiKey
In: header

예제

Analyze Document from Base64
Analyze Document from Url

Analyze Document from Base64

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentModels/prebuilt-layout:analyze?pages=1-2,4&locale=en-US&stringIndexType=textElements&api-version=2023-07-31

{
  "base64Source": "e2Jhc2U2NEVuY29kZWRQZGZ9"
}

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentModels/prebuilt-layout/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-07-31

Analyze Document from Url

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentModels/customModel:analyze?pages=1-2,4&locale=en-US&stringIndexType=textElements&api-version=2023-07-31

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

Sample Response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2023-07-31

정의

Name Description
AnalyzeDocumentRequest

문서 분석 매개 변수.

DocumentAnalysisFeature

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

Error

오류 정보입니다.

ErrorResponse

오류 응답 개체입니다.

InnerError

자세한 오류입니다.

StringIndexType

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

AnalyzeDocumentRequest

문서 분석 매개 변수.

Name 형식 Description
base64Source

string

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

urlSource

string

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

DocumentAnalysisFeature

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

Name 형식 Description
barcodes

string

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

formulas

string

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

keyValuePairs

string

문서에서 일반 키 값 쌍(양식 필드)의 검색을 사용하도록 설정합니다.

languages

string

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

ocrHighResolution

string

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

styleFont

string

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

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에서 사용됩니다.