你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Document Classifiers - Build Classifier
生成自定义文档分类器。
POST {endpoint}/formrecognizer/documentClassifiers:build?api-version=2023-07-31
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string url |
支持的认知服务终结点 (协议和主机名,例如: https://westus2.api.cognitive.microsoft.com) 。 |
api-version
|
query | True |
string |
请求的 API 版本。 |
请求头
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
Ocp-Apim-Subscription-Key | True |
string |
Azure 认知服务订阅的密钥。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
classifierId | True |
string |
唯一的文档分类器名称。 |
docTypes | True |
<string,
Classifier |
要分类的文档类型的列表。 |
description |
string |
文档分类器说明。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
请求已成功排队。 Headers Operation-Location: string |
|
Other Status Codes |
遇到错误。 |
安全性
Ocp-Apim-Subscription-Key
Azure 认知服务订阅的密钥。
Type:
apiKey
In:
header
示例
Build Document Classifier
Sample Request
POST https://myendpoint.cognitiveservices.azure.com/formrecognizer/documentClassifiers:build?api-version=2023-07-31
{
"classifierId": "myClassifier",
"description": "Classifier description",
"docTypes": {
"formA": {
"azureBlobSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"prefix": "formADocs/"
}
},
"formB": {
"azureBlobFileListSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"fileList": "formB.jsonl"
}
}
}
}
Sample Response
Operation-Location: https://myendpoint.cognitiveservices.azure.com/formrecognizer/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2023-07-31
定义
名称 | 说明 |
---|---|
Azure |
Azure Blob 存储内容。 |
Azure |
Azure Blob 存储 中的文件列表。 |
Build |
请求正文以生成新的自定义文档分类器。 |
Classifier |
分类器文档类型信息。 |
Error |
错误信息。 |
Error |
错误响应对象。 |
Inner |
详细错误。 |
AzureBlobContentSource
Azure Blob 存储内容。
名称 | 类型 | 说明 |
---|---|---|
containerUrl |
string |
Azure Blob 存储容器 URL。 |
prefix |
string |
Blob 名称前缀。 |
AzureBlobFileListContentSource
Azure Blob 存储 中的文件列表。
名称 | 类型 | 说明 |
---|---|---|
containerUrl |
string |
Azure Blob 存储容器 URL。 |
fileList |
string |
容器中 JSONL 文件的路径,该文件指定用于训练的文档子集。 |
BuildDocumentClassifierRequest
请求正文以生成新的自定义文档分类器。
名称 | 类型 | 说明 |
---|---|---|
classifierId |
string |
唯一的文档分类器名称。 |
description |
string |
文档分类器说明。 |
docTypes |
<string,
Classifier |
要分类的文档类型的列表。 |
ClassifierDocumentTypeDetails
分类器文档类型信息。
名称 | 类型 | 说明 |
---|---|---|
azureBlobFileListSource |
Azure Blob 存储指定分类器文档类型的训练数据的文件列表。 必须指定 azureBlobSource 或 azureBlobFileListSource。 |
|
azureBlobSource |
Azure Blob 存储包含分类器文档类型的训练数据的位置。 必须指定 azureBlobSource 或 azureBlobFileListSource。 |
Error
错误信息。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
details |
Error[] |
详细错误列表。 |
innererror |
详细错误。 |
|
message |
string |
错误消息。 |
target |
string |
错误的目标。 |
ErrorResponse
错误响应对象。
名称 | 类型 | 说明 |
---|---|---|
error |
错误信息。 |
InnerError
详细错误。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误代码。 |
innererror |
详细错误。 |
|
message |
string |
错误消息。 |