Document Models - Analyze Document

Belge modelini kullanarak belgeyi analiz eder.

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 Parametreleri

Name İçinde Gerekli Tür Description
endpoint
path True

string

url

Desteklenen Bilişsel Hizmetler uç noktaları (protokol ve konak adı, örneğin: https://westus2.api.cognitive.microsoft.com).

modelId
path True

string

Benzersiz belge modeli adı.

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

api-version
query True

string

İstenen API sürümü.

features
query

DocumentAnalysisFeature[]

İsteğe bağlı analiz özelliklerinin listesi.

locale
query

string

Metin tanıma ve belge analizi için yerel ayar ipucu. Değer yalnızca dil kodunu ("en", "fr") veya BCP 47 dil etiketini ("en-US") içerebilir.

pages
query

string

Analiz etmek için 1 tabanlı sayfa numaralarının listesi. Örn. "1-3,5,7-9"

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

stringIndexType
query

StringIndexType

Dize uzaklığını ve uzunluğunu hesaplamak için kullanılan yöntem.

İstek Başlığı

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 Gerekli Tür Description
Ocp-Apim-Subscription-Key True

string

Azure Bilişsel Hizmetler aboneliğinizin gizli anahtarı.

İstek Gövdesi

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 Tür Description
base64Source

string

Analiz için belgenin Base64 kodlaması. urlSource veya base64Source belirtilmelidir.

urlSource

string

Analiz için belge URL'si. urlSource veya base64Source belirtilmelidir.

Yanıtlar

Name Tür Description
202 Accepted

İstek başarıyla kuyruğa alındı.

Headers

Operation-Location: string

Other Status Codes

ErrorResponse

Hatayla karşılaşıldı.

Güvenlik

Ocp-Apim-Subscription-Key

Azure Bilişsel Hizmetler aboneliğinizin gizli anahtarı.

Type: apiKey
In: header

Örnekler

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

Tanımlar

Name Description
AnalyzeDocumentRequest

Belge çözümleme parametreleri.

DocumentAnalysisFeature

İsteğe bağlı analiz özelliklerinin listesi.

Error

Hata bilgileri.

ErrorResponse

Hata yanıtı nesnesi.

InnerError

Ayrıntılı hata.

StringIndexType

Dize uzaklığını ve uzunluğunu hesaplamak için kullanılan yöntem.

AnalyzeDocumentRequest

Belge çözümleme parametreleri.

Name Tür Description
base64Source

string

Analiz için belgenin Base64 kodlaması. urlSource veya base64Source belirtilmelidir.

urlSource

string

Analiz için belge URL'si. urlSource veya base64Source belirtilmelidir.

DocumentAnalysisFeature

İsteğe bağlı analiz özelliklerinin listesi.

Name Tür Description
barcodes

string

Belgede barkod algılamayı etkinleştirin.

formulas

string

Belgede matematiksel ifadelerin algılanması için etkinleştirme.

keyValuePairs

string

Belgede genel anahtar değer çiftlerini (form alanları) algılamayı etkinleştirin.

languages

string

Metin içerik dilini algılamayı etkinleştirin.

ocrHighResolution

string

Belgeleri düzgün yazdırarak işlemek için daha yüksek çözünürlükte OCR gerçekleştirin.

styleFont

string

Çeşitli yazı tipi stillerinin tanınmasını etkinleştirin.

Error

Hata bilgileri.

Name Tür Description
code

string

Hata kodu.

details

Error[]

Ayrıntılı hataların listesi.

innererror

InnerError

Ayrıntılı hata.

message

string

Hata iletisi.

target

string

Hatanın hedefi.

ErrorResponse

Hata yanıtı nesnesi.

Name Tür Description
error

Error

Hata bilgileri.

InnerError

Ayrıntılı hata.

Name Tür Description
code

string

Hata kodu.

innererror

InnerError

Ayrıntılı hata.

message

string

Hata iletisi.

StringIndexType

Dize uzaklığını ve uzunluğunu hesaplamak için kullanılan yöntem.

Name Tür Description
textElements

string

Unicode 8.0.0 tarafından tanımlandığı gibi kullanıcı tarafından algılanan görüntüleme karakteri veya grafeme kümesi.

unicodeCodePoint

string

Tek bir unicode kod noktasıyla temsil edilen karakter birimi. Python 3 tarafından kullanılır.

utf16CodeUnit

string

16 bit Unicode kod birimiyle temsil edilen karakter birimi. JavaScript, Java ve .NET tarafından kullanılır.