你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Document Models - Build Model
生成自定义文档分析模型。
POST {endpoint}/documentintelligence/documentModels:build?api-version=2024-02-29-preview
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
endpoint
|
path | True |
string |
文档智能服务终结点。 |
api-version
|
query | True |
string |
要用于此操作的 API 版本。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
buildMode | True |
Document |
自定义文档模型生成模式。 |
modelId | True |
string |
唯一的文档模型名称。 |
azureBlobFileListSource |
Azure |
Azure Blob 存储指定训练数据的文件列表。 必须指定 azureBlobSource 或 azureBlobFileListSource。 |
|
azureBlobSource |
Azure |
Azure Blob 存储包含训练数据的位置。 必须指定 azureBlobSource 或 azureBlobFileListSource。 |
|
description |
string |
文档模型说明。 |
|
tags |
object |
与文档模型关联的键值标记属性的列表。 |
响应
名称 | 类型 | 说明 |
---|---|---|
202 Accepted |
已接受请求进行处理,但处理尚未完成。 Headers
|
|
Other Status Codes |
Error |
意外的错误响应。 |
安全性
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 |
示例
Build Document Model
Sample Request
POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels:build?api-version=2024-02-29-preview
{
"modelId": "myCustomModel",
"description": "Custom model description",
"buildMode": "template",
"azureBlobSource": {
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer?mySasToken",
"prefix": "trainingDocs/"
},
"tags": {
"createdBy": "myUserId"
}
}
Sample Response
Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-02-29-preview
定义
名称 | 说明 |
---|---|
Azure |
Azure Blob 存储内容。 |
Azure |
Azure Blob 存储中的文件列表。 |
Build |
请求正文以生成新的自定义文档模型。 |
Document |
自定义文档模型生成模式。 |
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 文件的路径。 |
BuildDocumentModelRequest
请求正文以生成新的自定义文档模型。
名称 | 类型 | 说明 |
---|---|---|
azureBlobFileListSource |
Azure |
Azure Blob 存储指定训练数据的文件列表。 必须指定 azureBlobSource 或 azureBlobFileListSource。 |
azureBlobSource |
Azure |
Azure Blob 存储包含训练数据的位置。 必须指定 azureBlobSource 或 azureBlobFileListSource。 |
buildMode |
Document |
自定义文档模型生成模式。 |
description |
string |
文档模型说明。 |
modelId |
string |
唯一的文档模型名称。 |
tags |
object |
与文档模型关联的键值标记属性的列表。 |
DocumentBuildMode
自定义文档模型生成模式。
名称 | 类型 | 说明 |
---|---|---|
neural |
string |
支持具有各种视觉模板的文档。 |
template |
string |
使用类似视觉模板的目标文档。 |
Error
错误对象。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的一组错误代码中的一个。 |
details |
Error[] |
有关导致此项报告错误的特定错误的详细信息数组。 |
innererror |
Inner |
一个 对象,该对象包含比当前对象更具体的错误信息。 |
message |
string |
错误的用户可读表示形式。 |
target |
string |
错误的目标。 |
ErrorResponse
错误响应对象。
名称 | 类型 | 说明 |
---|---|---|
error |
错误信息。 |
InnerError
包含有关错误的更具体信息的对象。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
服务器定义的一组错误代码中的一个。 |
innererror |
Inner |
内部错误。 |
message |
string |
错误的用户可读表示形式。 |