你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Document Classifiers - Classify Document
使用文档分类器对文档进行分类。
POST {endpoint}/documentintelligence/documentClassifiers/{classifierId}:analyze?_overload=classifyDocument&api-version=2024-02-29-preview
POST {endpoint}/documentintelligence/documentClassifiers/{classifierId}:analyze?_overload=classifyDocument&api-version=2024-02-29-preview&stringIndexType={stringIndexType}&split={split}
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
classifier
|
path | True |
string |
唯一的文档分类器名称。 Regex pattern: |
endpoint
|
path | True |
string |
文档智能服务终结点。 |
api-version
|
query | True |
string |
要用于此操作的 API 版本。 |
split
|
query |
文档拆分模式。 |
||
string
|
query |
用于计算字符串偏移量和长度的方法。 |
请求正文
名称 | 类型 | 说明 |
---|---|---|
base64Source |
string |
要分类的文档的 Base64 编码。 必须指定 urlSource 或 base64Source。 |
urlSource |
string |
要分类的文档 URL。 必须指定 urlSource 或 base64Source。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
已接受请求进行处理,但尚未完成处理。 Headers
|
|
Other Status Codes |
意外的错误响应。 |
安全性
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?_overload=classifyDocument&api-version=2024-02-29-preview&stringIndexType=textElements
{
"urlSource": "http://host.com/doc.pdf"
}
Sample Response
Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentClassifiers/customClassifier/analyzeResults/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2024-02-29-preview
定义
名称 | 说明 |
---|---|
Classify |
文档分类参数。 |
Error |
错误对象。 |
Error |
错误响应对象。 |
Inner |
包含有关错误的更具体信息的对象。 |
Split |
文档拆分模式。 |
String |
用于计算字符串偏移量和长度的方法。 |
ClassifyDocumentRequest
文档分类参数。
名称 | 类型 | 说明 |
---|---|---|
base64Source |
string |
要分类的文档的 Base64 编码。 必须指定 urlSource 或 base64Source。 |
urlSource |
string |
要分类的文档 URL。 必须指定 urlSource 或 base64Source。 |
Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的一组错误代码中的一个。 |
details |
Error[] |
有关导致此项报告错误的特定错误的详细信息数组。 |
innererror |
一个 对象,该对象包含比当前对象更具体的错误信息。 |
|
message |
string |
错误的用户可读表示形式。 |
target |
string |
错误的目标。 |
ErrorResponse
错误响应对象。
名称 | 类型 | 说明 |
---|---|---|
error |
错误信息。 |
InnerError
包含有关错误的更具体信息的对象。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的一组错误代码中的一个。 |
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 使用。 |