Content Analyzers - Create Or Replace
异步创建一个新的分析仪。
PUT {endpoint}/contentunderstanding/analyzers/{analyzerId}?api-version=2025-11-01
PUT {endpoint}/contentunderstanding/analyzers/{analyzerId}?api-version=2025-11-01&allowReplace={allowReplace}
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
analyzer
|
path | True |
string minLength: 1maxLength: 64 pattern: ^[a-zA-Z0-9._-]{1,64}$ |
分析仪的唯一标识符。 |
|
endpoint
|
path | True |
string (uri) |
内容理解服务端点。 |
|
api-version
|
query | True |
string minLength: 1 |
要用于此操作的 API 版本。 |
|
allow
|
query |
boolean |
允许作替换现有资源。 |
请求头
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| x-ms-client-request-id |
string (uuid) |
请求的不透明、全局唯一的客户端生成的字符串标识符。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| baseAnalyzerId |
string minLength: 1maxLength: 64 pattern: ^[a-zA-Z0-9._-]{1,64}$ |
分析器可以逐步训练。 |
| config |
分析仪配置设置。 |
|
| description |
string |
分析仪的描述。 |
| dynamicFieldSchema |
boolean |
表示结果是否可能包含定义模式之外的其他字段。 |
| fieldSchema |
需要提取的场图式。 |
|
| knowledgeSources | KnowledgeSource[]: |
用于增强分析仪的额外知识来源。 |
| models |
object |
将模型角色映射到特定型号名称。 例如: { “完成”: “gpt-4.1”, “embedding”: “text-embedding-3-large” }. |
| processingLocation |
数据可能被处理的地点。 默认是全局。 |
|
| tags |
object |
与分析仪相关的标签。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
请求已成功。 标头
|
|
| 201 Created |
请求已成功,因此创建了一个新资源。 标头
|
|
| Other Status Codes |
意外的错误响应。 标头 x-ms-error-code: string |
安全性
Ocp-Apim-Subscription-Key
基于密钥的认证,使用Azure资源的访问密钥。
类型:
apiKey
在:
header
EntraIdToken
Microsoft Entra ID OAuth2 使用访问令牌进行认证。
类型:
oauth2
流向:
accessCode
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
令牌 URL:
https://login.microsoftonline.com/common/oauth2/token
作用域
| 名称 | 说明 |
|---|---|
| https://cognitiveservices.azure.com/.default |
示例
Create or Replace Analyzer
示例请求
PUT {endpoint}/contentunderstanding/analyzers/myAnalyzer?api-version=2025-11-01
{
"description": "My analyzer",
"tags": {
"createdBy": "John"
},
"baseAnalyzerId": "prebuilt-document",
"config": {
"enableFormula": false,
"returnDetails": true
},
"fieldSchema": {
"name": "MyForm",
"description": "My form",
"fields": {
"Company": {
"type": "string",
"description": "Name of company."
}
},
"definitions": {}
},
"knowledgeSources": [
{
"kind": "labeledData",
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer",
"prefix": "trainingData",
"fileListPath": "trainingData/fileList.jsonl"
}
]
}
示例响应
Operation-Location: https://myendpoint.cognitiveservices.azure.com/contentunderstanding/analyzers/myAnalyzer/operations/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2025-11-01
{
"analyzerId": "myAnalyzer",
"description": "My analyzer",
"tags": {
"createdBy": "John"
},
"status": "creating",
"createdAt": "2025-05-01T18:46:36.051Z",
"lastModifiedAt": "2025-05-01T18:46:36.051Z",
"baseAnalyzerId": "prebuilt-document",
"config": {
"locales": null,
"enableOcr": true,
"enableLayout": true,
"enableFormula": false,
"returnDetails": true
},
"fieldSchema": {
"name": "MyForm",
"description": "My form",
"fields": {
"Company": {
"type": "string",
"description": "Name of company."
}
},
"definitions": {}
},
"knowledgeSources": [
{
"kind": "labeledData",
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer",
"prefix": "trainingData",
"fileListPath": "trainingData/fileList.jsonl"
}
]
}
Operation-Location: https://myendpoint.cognitiveservices.azure.com/contentunderstanding/analyzers/myAnalyzer/operations/3b31320d-8bab-4f88-b19c-2322a7f11034?api-version=2025-11-01
{
"analyzerId": "myAnalyzer",
"description": "My analyzer",
"tags": {
"createdBy": "John"
},
"status": "creating",
"createdAt": "2025-05-01T18:46:36.051Z",
"lastModifiedAt": "2025-05-01T18:46:36.051Z",
"baseAnalyzerId": "prebuilt-document",
"config": {
"locales": null,
"enableOcr": true,
"enableLayout": true,
"enableFormula": false,
"returnDetails": true
},
"fieldSchema": {
"name": "MyForm",
"description": "My form",
"fields": {
"Company": {
"type": "string",
"description": "Name of company."
}
},
"definitions": {}
},
"knowledgeSources": [
{
"kind": "labeledData",
"containerUrl": "https://myStorageAccount.blob.core.windows.net/myContainer",
"prefix": "trainingData",
"fileListPath": "trainingData/fileList.jsonl"
}
]
}
定义
| 名称 | 说明 |
|---|---|
|
Annotation |
分析结果标记的表示格式。 |
|
Azure. |
错误对象。 |
|
Azure. |
包含错误详细信息的响应。 |
|
Azure. |
包含有关错误的更具体信息的对象。 根据 Azure REST API 准则 - https://aka.ms/AzureRestApiGuidelines#handling-errors。 |
|
Chart |
分析结果 Markdown 中图表的表示格式。 |
|
Content |
分析器,可以从多模态文档中提取内容和字段。 |
|
Content |
分析仪的配置设置。 |
|
Content |
资源状态。 |
|
Content |
内容类别定义。 |
|
Content |
用类似语法的 JSON Schema 来定义字段。 |
|
Content |
从文档中提取字段的结构。 |
|
Content |
字段值的语义数据类型。 |
|
Generation |
生成方法。 |
|
Knowledge |
知识来源类型。 |
|
Labeled |
标记为数据知识源。 |
|
Processing |
数据可能被处理的地点。 默认是全局。 |
|
Supported |
分析仪支持的聊天完成和嵌入模型。 |
|
Table |
分析结果 Markdown 中表格的表示格式。 |
AnnotationFormat
分析结果标记的表示格式。
| 值 | 说明 |
|---|---|
| none |
不表示注释。 |
| markdown |
使用markdown格式表示基本注释信息。 |
Azure.Core.Foundations.Error
错误对象。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
服务器定义的错误代码集之一。 |
| details |
导致此报告错误的特定错误的详细信息数组。 |
|
| innererror |
包含与当前对象有关错误的更具体信息的对象。 |
|
| message |
string |
错误的人工可读表示形式。 |
| target |
string |
错误的目标。 |
Azure.Core.Foundations.ErrorResponse
包含错误详细信息的响应。
| 名称 | 类型 | 说明 |
|---|---|---|
| error |
错误对象。 |
Azure.Core.Foundations.InnerError
包含有关错误的更具体信息的对象。 根据 Azure REST API 准则 - https://aka.ms/AzureRestApiGuidelines#handling-errors。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
服务器定义的错误代码集之一。 |
| innererror |
内部错误。 |
ChartFormat
分析结果 Markdown 中图表的表示格式。
| 值 | 说明 |
|---|---|
| chartJs |
将图表表示为 Chart.js 代码块。 |
| markdown |
用降价表表示图表。 |
ContentAnalyzer
分析器,可以从多模态文档中提取内容和字段。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| analyzerId |
string minLength: 1maxLength: 64 pattern: ^[a-zA-Z0-9._-]{1,64}$ |
分析仪的唯一标识符。 |
|
| baseAnalyzerId |
string minLength: 1maxLength: 64 pattern: ^[a-zA-Z0-9._-]{1,64}$ |
分析器可以逐步训练。 |
|
| config |
分析仪配置设置。 |
||
| createdAt |
string (date-time) |
分析仪诞生的日期和时间。 |
|
| description |
string |
分析仪的描述。 |
|
| dynamicFieldSchema |
boolean |
False |
表示结果是否可能包含定义模式之外的其他字段。 |
| fieldSchema |
需要提取的场图式。 |
||
| knowledgeSources | KnowledgeSource[]: |
用于增强分析仪的额外知识来源。 |
|
| lastModifiedAt |
string (date-time) |
分析仪最后修改的日期和时间。 |
|
| models |
object |
将模型角色映射到特定型号名称。 例如: { “完成”: “gpt-4.1”, “embedding”: “text-embedding-3-large” }. |
|
| processingLocation | global |
数据可能被处理的地点。 默认是全局。 |
|
| status |
分析仪状态。 |
||
| supportedModels |
分析仪支持的聊天完成和嵌入模型。 |
||
| tags |
object |
与分析仪相关的标签。 |
|
| warnings |
在创建分析仪时遇到的警告。 |
ContentAnalyzerConfig
分析仪的配置设置。
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| annotationFormat | markdown |
分析结果标记的表示格式。 |
|
| chartFormat | chartJs |
分析结果 Markdown 中图表的表示格式。 |
|
| contentCategories |
<string,
Content |
分类映射用于分类输入内容。 |
|
| disableFaceBlurring |
boolean |
在处理内容时关闭默认的面部模糊以保护隐私。 |
|
| enableFigureAnalysis |
boolean |
支持图表和示意图等数据分析。 |
|
| enableFigureDescription |
boolean |
启用图形描述生成。 |
|
| enableFormula |
boolean |
启用数学公式检测。 |
|
| enableLayout |
boolean |
启用布局分析。 |
|
| enableOcr |
boolean |
启用光学字符识别(OCR)。 |
|
| enableSegment |
boolean |
启用按内容类别对输入进行细分。 |
|
| estimateFieldSourceAndConfidence |
boolean |
返回场地源和信心。 |
|
| locales |
string[] |
语音转录的地点提示列表。 |
|
| omitContent |
boolean |
分析结果中省略该分析器的内容。 仅返回来自contentCategories中指定的额外分析器的内容(如有)。 |
|
| returnDetails |
boolean |
返回所有内容详情。 |
|
| segmentPerPage |
boolean |
强制按页面分割文档内容。 |
|
| tableFormat | html |
分析结果 Markdown 中表格的表示格式。 |
ContentAnalyzerStatus
资源状态。
| 值 | 说明 |
|---|---|
| creating |
正在创建资源。 |
| ready |
资源已经准备好了。 |
| deleting |
正在删除此资源。 |
| failed |
资源在创建过程中失效。 |
ContentCategoryDefinition
内容类别定义。
| 名称 | 类型 | 说明 |
|---|---|---|
| analyzer |
可选的分析仪内联定义用于处理内容。 |
|
| analyzerId |
string |
可选分析仪用于处理内容。 |
| description |
string |
类别的说明。 |
ContentFieldDefinition
用类似语法的 JSON Schema 来定义字段。
| 名称 | 类型 | 说明 |
|---|---|---|
| $ref |
string |
参考另一个场定义。 |
| description |
string |
现场描述。 |
| enum |
string[] |
可能场值的枚举。 |
| enumDescriptions |
object |
每个枚举值的描述。 |
| estimateSourceAndConfidence |
boolean |
回归接地源和信心。 |
| examples |
string[] |
场值示例。 |
| items |
如果 数组是数组,则每个数组元素的字段类型模式。 |
|
| method |
生成方法。 |
|
| properties |
<string,
Content |
如果类型是对象,则命名子字段。 |
| type |
字段值的语义数据类型。 |
ContentFieldSchema
从文档中提取字段的结构。
| 名称 | 类型 | 说明 |
|---|---|---|
| definitions |
<string,
Content |
模式中字段引用的额外定义。 |
| description |
string |
字段模式描述。 |
| fields |
<string,
Content |
模式中定义的字段。 |
| name |
string |
字段模式的名称。 |
ContentFieldType
字段值的语义数据类型。
| 值 | 说明 |
|---|---|
| string |
纯文本。 |
| date |
日期,标准化为ISO 8601(YYYY-MM-DD)格式。 |
| time |
时间,归一化为ISO 8601(hh:mm:ss)格式。 |
| number |
数字是双精度浮点数。 |
| integer |
整数为64位带符号整数。 |
| boolean |
布尔值。 |
| array |
同类型的子字段列表。 |
| object |
子字段的命名列表。 |
| json |
JSON 对象。 |
GenerationMethod
生成方法。
| 值 | 说明 |
|---|---|
| generate |
价值是基于内容自由生成的。 |
| extract |
数值在内容中出现时被提取。 |
| classify |
价值会根据预设的类别进行分类。 |
KnowledgeSourceKind
知识来源类型。
| 值 | 说明 |
|---|---|
| labeledData |
一个有标签的数据知识源。 |
LabeledDataKnowledgeSource
标记为数据知识源。
| 名称 | 类型 | 说明 |
|---|---|---|
| containerUrl |
string (uri) |
包含标记数据的blob容器的URL。 |
| fileListPath |
string |
一个可选路径指向一个列出具体需要包含的blob的文件路径。 |
| kind |
string:
labeled |
那种知识来源。 |
| prefix |
string |
一个可选的前缀用于过滤容器内的斑点。 |
ProcessingLocation
数据可能被处理的地点。 默认是全局。
| 值 | 说明 |
|---|---|
| geography |
数据可能与资源在同一地理范围内处理。 |
| dataZone |
数据可以在与资源相同的数据区域内处理。 |
| global |
数据可以在全球任何 Azure 数据中心处理。 |
SupportedModels
分析仪支持的聊天完成和嵌入模型。
| 名称 | 类型 | 说明 |
|---|---|---|
| completion |
string[] |
分析仪支持的聊天完成模型。 |
| embedding |
string[] |
分析仪支持的嵌入模型。 |
TableFormat
分析结果 Markdown 中表格的表示格式。
| 值 | 说明 |
|---|---|
| html |
用HTML表元素表示表:<table、th>、<<tr>、<td>>。 |
| markdown |
使用GitHub风格的Markdown表格语法表示表格,该语法不支持合并单元格或丰富首部。 |