Document Models - Analyze Document
ドキュメント モデルを使用してドキュメントを分析します。
POST {endpoint}/documentintelligence/documentModels/{modelId}:analyze?_overload=analyzeDocument&api-version=2024-11-30
POST {endpoint}/documentintelligence/documentModels/{modelId}:analyze?_overload=analyzeDocument&api-version=2024-11-30&pages={pages}&locale={locale}&stringIndexType={stringIndexType}&features={features}&queryFields={queryFields}&outputContentFormat={outputContentFormat}&output={output}
URI パラメーター
| 名前 | / | 必須 | 型 | 説明 |
|---|---|---|---|---|
|
endpoint
|
path | True |
string (uri) |
ドキュメント インテリジェンス サービス エンドポイント。 |
|
model
|
path | True |
string maxLength: 64pattern: ^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$ |
一意のドキュメント モデル名。 |
|
api-version
|
query | True |
string minLength: 1 |
この操作に使用する API バージョン。 |
|
features
|
query |
オプションの分析機能の一覧。 |
||
|
locale
|
query |
string |
テキスト認識とドキュメント分析のロケール ヒント。 値には、言語コード (例: "en"、"fr") または BCP 47 言語タグ (例: "en-US") のみを含むことができます。 |
|
|
output
|
query |
分析中に生成する追加の出力。 |
||
|
output
|
query |
分析結果の最上位コンテンツの形式。 |
||
|
pages
|
query |
string pattern: ^(\d+(-\d+)?)(,\s*(\d+(-\d+)?))*$ |
分析する 1 から始まるページ番号。 旧。 "1-3,5,7-9" |
|
|
query
|
query |
string[] |
抽出する追加フィールドの一覧。 旧。 "NumberOfGuests,StoreNumber" |
|
|
string
|
query |
文字列のオフセットと長さを計算するために使用されるメソッド。 |
要求本文
| 名前 | 型 | 説明 |
|---|---|---|
| base64Source |
string (byte) |
分析するドキュメントの Base64 エンコード。 urlSource または base64Source を指定する必要があります。 |
| urlSource |
string (uri) |
分析するドキュメント URL。 urlSource または base64Source を指定する必要があります。 |
応答
| 名前 | 型 | 説明 |
|---|---|---|
| 202 Accepted |
要求は処理のために受け入れ済みですが、処理はまだ完了していません。 ヘッダー
|
|
| Other Status Codes |
予期しないエラー応答。 |
セキュリティ
Ocp-Apim-Subscription-Key
型:
apiKey
/:
header
OAuth2Auth
型:
oauth2
フロー:
accessCode
Authorization URL (承認 URL):
https://login.microsoftonline.com/common/oauth2/authorize
Token URL (トークン URL):
https://login.microsoftonline.com/common/oauth2/token
スコープ
| 名前 | 説明 |
|---|---|
| https://cognitiveservices.azure.com/.default |
例
| Analyze Document from Base64 |
| Analyze Document from Url |
Analyze Document from Base64
要求のサンプル
POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/prebuilt-layout:analyze?_overload=analyzeDocument&api-version=2024-11-30&pages=1-2,4&locale=en-US&stringIndexType=textElements
{
"base64Source": "e2Jhc2U2NEVuY29kZWRQZGZ9"
}
応答のサンプル
Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/prebuilt-layout/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-11-30
Analyze Document from Url
要求のサンプル
POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel:analyze?_overload=analyzeDocument&api-version=2024-11-30&pages=1-2,4&locale=en-US&stringIndexType=textElements
{
"urlSource": "http://host.com/doc.pdf"
}
応答のサンプル
Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/customModel/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-11-30
定義
| 名前 | 説明 |
|---|---|
|
Analyze |
ドキュメント分析パラメーター。 |
|
Analyze |
分析中に生成する追加の出力。 |
|
Document |
有効にするドキュメント分析機能。 |
|
Document |
分析された結果のコンテンツの形式。 |
|
Document |
エラー オブジェクト。 |
|
Document |
エラー応答オブジェクト。 |
|
Document |
エラーに関するより具体的な情報を含むオブジェクト。 |
|
String |
文字列のオフセットと長さを計算するために使用されるメソッド。 |
AnalyzeDocumentRequest
ドキュメント分析パラメーター。
| 名前 | 型 | 説明 |
|---|---|---|
| base64Source |
string (byte) |
分析するドキュメントの Base64 エンコード。 urlSource または base64Source を指定する必要があります。 |
| urlSource |
string (uri) |
分析するドキュメント URL。 urlSource または base64Source を指定する必要があります。 |
AnalyzeOutputOption
分析中に生成する追加の出力。
| 値 | 説明 |
|---|---|
|
検索可能な PDF 出力を生成します。 |
|
| figures |
検出された図のトリミングされた画像を生成します。 |
DocumentAnalysisFeature
有効にするドキュメント分析機能。
| 値 | 説明 |
|---|---|
| ocrHighResolution |
より高い解像度で OCR を実行して、細かい印刷でドキュメントを処理します。 |
| languages |
テキスト コンテンツ言語の検出を有効にします。 |
| barcodes |
ドキュメント内のバーコードの検出を有効にします。 |
| formulas |
ドキュメント内の数式の検出を有効にします。 |
| keyValuePairs |
ドキュメント内の一般的なキー値ペア (フォーム フィールド) の検出を有効にします。 |
| styleFont |
さまざまなフォント スタイルの認識を有効にします。 |
| queryFields |
queryFields クエリ パラメーターを使用して、追加のフィールドの抽出を有効にします。 |
DocumentContentFormat
分析された結果のコンテンツの形式。
| 値 | 説明 |
|---|---|
| text |
書式を設定せずにドキュメント コンテンツをプレーン テキストで表現します。 |
| markdown |
セクション見出し、テーブルなどを含むドキュメント コンテンツのマークダウン表現。 |
DocumentIntelligenceError
エラー オブジェクト。
| 名前 | 型 | 説明 |
|---|---|---|
| code |
string |
サーバー定義の一連のエラー コードの 1 つ。 |
| details |
この報告されたエラーの原因となった特定のエラーに関する詳細の配列。 |
|
| innererror |
エラーに関する現在のオブジェクトよりも具体的な情報を含むオブジェクト。 |
|
| message |
string |
エラーの人間が判読できる表現。 |
| target |
string |
エラーのターゲット。 |
DocumentIntelligenceErrorResponse
エラー応答オブジェクト。
| 名前 | 型 | 説明 |
|---|---|---|
| error |
エラー情報。 |
DocumentIntelligenceInnerError
エラーに関するより具体的な情報を含むオブジェクト。
| 名前 | 型 | 説明 |
|---|---|---|
| code |
string |
サーバー定義の一連のエラー コードの 1 つ。 |
| innererror |
内部エラー。 |
|
| message |
string |
エラーの人間が判読できる表現。 |
StringIndexType
文字列のオフセットと長さを計算するために使用されるメソッド。
| 値 | 説明 |
|---|---|
| textElements |
Unicode 8.0.0 で定義されている、ユーザーが認識する表示文字 (grapheme クラスター)。 |
| unicodeCodePoint |
1 つの Unicode コード ポイントで表される文字単位。 Python 3 で使用されます。 |
| utf16CodeUnit |
16 ビット Unicode コード単位で表される文字単位。 JavaScript、Java、および .NET によって使用されます。 |