你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

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 参数

名称 必需 类型 说明
classifierId
path True

string

唯一的文档分类器名称。

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

endpoint
path True

string

文档智能服务终结点。

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"

名称 类型 说明
input

string

输入内容。

响应

名称 类型 说明
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

名称 说明
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

定义

名称 说明
Error

错误对象。

ErrorResponse

错误响应对象。

InnerError

包含有关错误的更具体信息的对象。

SplitMode

文档拆分模式。

StringIndexType

用于计算字符串偏移量和长度的方法。

Error

错误对象。

名称 类型 说明
code

string

服务器定义的一组错误代码中的一个。

details

Error[]

有关导致此项报告错误的特定错误的详细信息数组。

innererror

InnerError

一个 对象,该对象包含比当前对象更具体的错误信息。

message

string

错误的用户可读表示形式。

target

string

错误的目标。

ErrorResponse

错误响应对象。

名称 类型 说明
error

Error

错误信息。

InnerError

包含有关错误的更具体信息的对象。

名称 类型 说明
code

string

服务器定义的一组错误代码中的一个。

innererror

InnerError

内部错误。

message

string

错误的用户可读表示形式。

SplitMode

文档拆分模式。

名称 类型 说明
auto

string

自动将文件拆分为文档。

none

string

将整个文件视为单个文档。

perPage

string

将文件中的每个页面视为单独的文档。

StringIndexType

用于计算字符串偏移量和长度的方法。

名称 类型 说明
textElements

string

Unicode 8.0.0 定义的用户感知显示字符或图形群集。

unicodeCodePoint

string

由单个 unicode 码位表示的字符单位。 由 Python 3 使用。

utf16CodeUnit

string

由 16 位 Unicode 代码单元表示的字符单元。 由 JavaScript、Java 和 .NET 使用。