共用方式為


Document Classifiers - Classify Document From Stream

使用檔案分類器來分類檔。

POST {endpoint}/documentintelligence/documentClassifiers/{classifierId}:analyze?api-version=2024-02-29-preview
POST {endpoint}/documentintelligence/documentClassifiers/{classifierId}:analyze?api-version=2024-02-29-preview&stringIndexType={stringIndexType}&split={split}

URI 參數

名稱 位於 必要 類型 Description
classifierId
path True

string

唯一的檔分類器名稱。

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

endpoint
path True

string

Document Intelligence 服務端點。

api-version
query True

string

用於此作業的 API 版本。

split
query

SplitMode

檔分割模式。

stringIndexType
query

StringIndexType

用來計算字串位移和長度的方法。

要求本文

Media Types: "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"

名稱 類型 Description
input

string

輸入內容。

回應

名稱 類型 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

名稱 Description
https://cognitiveservices.azure.com/.default

範例

Classify Document from Url

Sample Request

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/classifierId:analyze?api-version=2024-02-29-preview&stringIndexType=textElements

"{binaryFile}"

Sample Response

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

定義

名稱 Description
Error

error 物件。

ErrorResponse

錯誤回應物件。

InnerError

物件,包含錯誤的詳細資訊。

SplitMode

檔分割模式。

StringIndexType

用來計算字串位移和長度的方法。

Error

error 物件。

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

details

Error[]

導致此錯誤之特定錯誤的詳細數據陣列。

innererror

InnerError

物件,包含比目前對象有關錯誤更具體的資訊。

message

string

人類可讀取的錯誤表示法。

target

string

錯誤的目標。

ErrorResponse

錯誤回應物件。

名稱 類型 Description
error

Error

錯誤資訊。

InnerError

物件,包含錯誤的詳細資訊。

名稱 類型 Description
code

string

其中一組伺服器定義的錯誤碼。

innererror

InnerError

內部錯誤。

message

string

人類可讀取的錯誤表示法。

SplitMode

檔分割模式。

名稱 類型 Description
auto

string

自動將檔案分割成檔。

none

string

將整個檔案視為單一檔。

perPage

string

將檔案中的每個頁面視為個別的檔。

StringIndexType

用來計算字串位移和長度的方法。

名稱 類型 Description
textElements

string

由 Unicode 8.0.0 所定義的使用者感知顯示字元或 grapheme 叢集。

unicodeCodePoint

string

以單一 Unicode 字碼點表示的字元單位。 由 Python 3 使用。

utf16CodeUnit

string

以16位 Unicode 程式代碼單位表示的字元單位。 由 JavaScript、Java 和 .NET 使用。