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 パラメーター

名前 / 必須 説明
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"

名前 必須 説明
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"

名前 説明
base64Source

string

分析するドキュメントの Base64 エンコード。 urlSource または base64Source を指定する必要があります。

urlSource

string

分析するドキュメント URL。 urlSource または base64Source を指定する必要があります。

応答

名前 説明
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

定義

名前 説明
AnalyzeDocumentRequest

ドキュメント分析パラメーター。

DocumentAnalysisFeature

オプションの分析機能の一覧。

Error

エラー情報。

ErrorResponse

エラー応答オブジェクト。

InnerError

詳細なエラー。

StringIndexType

文字列のオフセットと長さを計算するために使用されるメソッド。

AnalyzeDocumentRequest

ドキュメント分析パラメーター。

名前 説明
base64Source

string

分析するドキュメントの Base64 エンコード。 urlSource または base64Source を指定する必要があります。

urlSource

string

分析するドキュメント URL。 urlSource または base64Source を指定する必要があります。

DocumentAnalysisFeature

オプションの分析機能の一覧。

名前 説明
barcodes

string

ドキュメント内のバーコードの検出を有効にします。

formulas

string

ドキュメント内の数式の検出を有効にします。

keyValuePairs

string

ドキュメント内の一般的なキー値ペア (フォーム フィールド) の検出を有効にします。

languages

string

テキスト コンテンツ言語の検出を有効にします。

ocrHighResolution

string

高解像度で OCR を実行して、細かい印刷でドキュメントを処理します。

styleFont

string

さまざまなフォント スタイルの認識を有効にします。

Error

エラー情報。

名前 説明
code

string

エラー コード。

details

Error[]

詳細なエラーの一覧。

innererror

InnerError

詳細なエラー。

message

string

エラー メッセージ。

target

string

エラーのターゲット。

ErrorResponse

エラー応答オブジェクト。

名前 説明
error

Error

エラー情報。

InnerError

詳細なエラー。

名前 説明
code

string

エラー コード。

innererror

InnerError

詳細なエラー。

message

string

エラー メッセージ。

StringIndexType

文字列のオフセットと長さを計算するために使用されるメソッド。

名前 説明
textElements

string

Unicode 8.0.0 で定義されているユーザー認識表示文字 (Grapheme クラスター)。

unicodeCodePoint

string

1 つの Unicode コード ポイントで表される文字単位。 Python 3 で使用されます。

utf16CodeUnit

string

16 ビット Unicode コード単位で表される文字単位。 JavaScript、Java、.NET で使用されます。