uip IXP 文档和模型;标签
“uip 智能提取处理 (IXP) 文档”和“uip 智能提取处理 (IXP) 标签”的语法和选项,用于管理训练文档并审核/确认模型对这些文档的预测。
uip ixp documents,管理项目的原始训练文档(上传/下载/删除/列出)。uip ixp labellings 审核并确认模型对这些文档的预测,此为人机回圈步骤,用于生成用于重新训练的基本事实。请参阅父页面上的“概念” ,了解这在训练循环中的作用。
大纲
uip ixp documents list <project-name> [-l, --limit <n>] [--offset <n>]
uip ixp documents download <project-name> <document-id> [-o, --output <path>]
uip ixp documents upload <project-name> <file>
uip ixp documents delete <project-name> <document-id> -y
uip ixp labellings confirm <project-name> [document-id] [-f, --fields <ids>] [-c, --corrections <json>] [--group <name>] [--occurrence <n>] [--updates <json>] [-m, --model-version <n>]
uip ixp labellings unconfirm <project-name> <document-id> [-f, --fields <ids>] [--group <name>] [--occurrence <n>] [--updates <json>]
uip ixp labellings mark-missing <project-name> <document-id> -f, --fields <ids>
uip ixp labellings get-predictions <project-name> [document-id]
uip ixp documents list <project-name> [-l, --limit <n>] [--offset <n>]
uip ixp documents download <project-name> <document-id> [-o, --output <path>]
uip ixp documents upload <project-name> <file>
uip ixp documents delete <project-name> <document-id> -y
uip ixp labellings confirm <project-name> [document-id] [-f, --fields <ids>] [-c, --corrections <json>] [--group <name>] [--occurrence <n>] [--updates <json>] [-m, --model-version <n>]
uip ixp labellings unconfirm <project-name> <document-id> [-f, --fields <ids>] [--group <name>] [--occurrence <n>] [--updates <json>]
uip ixp labellings mark-missing <project-name> <document-id> -f, --fields <ids>
uip ixp labellings get-predictions <project-name> [document-id]
UIP IXP 文档
读取 IXP 文档内容。
uip IXP 文档列表
列出项目中的所有文档。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
选项
| 短 | 长 | 值 | 默认 | 描述 |
|---|---|---|---|---|
-l | --limit <number> | 1-10000 | 50 | 要返回的项目数。 |
| — | --offset <number> | 0-1000000 | 0 | 要跳过的项目数量。 |
示例
uip ixp documents list my-invoices
uip ixp documents list my-invoices
uip ixp documents list my-invoices --limit 100 --offset 100
uip ixp documents list my-invoices --limit 100 --offset 100
数据形状(--输出 json)
{
"Code": "IxpDocumentsList",
"Data": {
"Documents": [
{ "DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21", "AttachmentRef": "c1a7e9d3-8b2f-4e60-9a15-7d3c6f0b4e28", "Filename": "invoice-001.pdf" }
],
"Total": 120,
"Offset": 0,
"Limit": 50
}
}
{
"Code": "IxpDocumentsList",
"Data": {
"Documents": [
{ "DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21", "AttachmentRef": "c1a7e9d3-8b2f-4e60-9a15-7d3c6f0b4e28", "Filename": "invoice-001.pdf" }
],
"Total": 120,
"Offset": 0,
"Limit": 50
}
}
uip IXP 文档下载
下载原始文档文件(PDF/PNG/JPG 等)以供查看。文件的扩展名会自动更正,以匹配服务器报告的实际内容类型 — 它不信任 --output 的扩展名。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
<document-id> | 是 | 文档 ID。 |
选项
| 短 | 长 | 值 | 默认 | 描述 |
|---|---|---|---|---|
-o | --output <path> | 路径 | 生成的 tmpdir 路径 | 输出文件路径。扩展名会自动更正(例如.jpeg/.tiff 被视为与 .jpg/.tif 等效,否则将替换/附加不匹配或缺失的扩展名。 |
示例
uip ixp documents download my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 -o ./doc
uip ixp documents download my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 -o ./doc
数据形状(--输出 json)
{
"Code": "IxpDocumentsDownload",
"Data": { "Path": "./doc.pdf", "ContentType": "application/pdf", "SizeBytes": 102400 }
}
{
"Code": "IxpDocumentsDownload",
"Data": { "Path": "./doc.pdf", "ContentType": "application/pdf", "SizeBytes": 102400 }
}
uip IXP 文档上传
将文档文件上传到现有项目。在任何网络调用之前拒绝客户端不支持的文件扩展名。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
<file> | 是 | 要上传的文档文件的路径。 |
示例
uip ixp documents upload my-invoices ./invoice.pdf
uip ixp documents upload my-invoices ./invoice.pdf
数据形状(--输出 json)
{
"Code": "IxpDocumentsUpload",
"Data": {
"ProjectName": "my-invoices",
"Filename": "invoice.pdf",
"AttachmentRef": "c1a7e9d3-8b2f-4e60-9a15-7d3c6f0b4e28",
"DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21"
}
}
{
"Code": "IxpDocumentsUpload",
"Data": {
"ProjectName": "my-invoices",
"Filename": "invoice.pdf",
"AttachmentRef": "c1a7e9d3-8b2f-4e60-9a15-7d3c6f0b4e28",
"DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21"
}
}
UIP IXP 文档删除
从项目中删除文档。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
<document-id> | 是 | 文档 ID。 |
选项
| 短 | 长 | 必填 | 描述 |
|---|---|---|---|
-y | --yes | 是 | 确认此不可逆操作。 |
示例
uip ixp documents delete my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21
uip ixp documents delete my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21
数据形状(--输出 json)
{ "Code": "IxpDocumentsDelete", "Data": { "Status": "ok" } }
{ "Code": "IxpDocumentsDelete", "Data": { "Status": "ok" } }
uip IXP 标签
管理智能提取处理 (IXP) 标签和预测 — 将模型预测转变为已确认的基本事实的人工审核步骤。
和confirm和get-predictions接受可选的[document-id] — 省略该选项会将操作应用于项目中的每个文档。此项目范围内的表单已弃用,将在未来的版本中删除;如果您省略[WARN]行,则系统会将其写入标准错误(标准输出仍可用于--output json脚本的解析)。传递通过 uip ixp documents list 找到的文档 ID。
可重复字段组:定位出现次数
对于可重复的字段组(例如“行项目”每个发票行出现一次),confirm 和 unconfirm 通过 --group 共享一个通用的定位模型:
| 标记 | 效果 |
|---|---|
--group <name> 单独 | 定位该组的每次出现。 |
--group <name> --occurrence <n> | 仅以出现一次为目标(索引从 0 开始)— 单行人类工效形式。需要 --group 和文档 ID。 |
--group <name> --updates <json> | 以一次基本调用中的多个特定匹配项为目标: [{"occurrence":<n>,"fields"?:[...],"corrections"?:{...}}] (确认)或[{"occurrence":<n>,"fields"?:[...]}] (取消确认)。--updates 是超集 — --occurrence <n> 等效于单条目 --updates。与 --occurrence、--fields 及(适用于 confirm)--corrections 互斥。 |
--group必须是Name输出的get-predictions字段中显示的完整标签路径(例如"Invoice > Line Items"),而不仅仅是叶名称。
uip IXP 标签确认
确认智能提取处理 (IXP) 生成的预测为一个文档的基本事实。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
[document-id] | 否 | 文档 ID。省略此选项则会确认项目中的每个文档 —已弃用。 |
选项
| 短 | 长 | 值 | 描述 |
|---|---|---|---|
-f | --fields <field-ids> | 逗号分隔 | 要确认的字段 ID。省略确认所有预测字段。如无 --group,则在每次字段出现 ID 时确认每个字段 ID;使用 --group --occurrence,则仅在该出现的范围内确认。 |
-c | --corrections <json> | JSON 数组 | 在保留引用的同时覆盖预测值:[{"field_id":"...","value":"corrected"}]。适用于出现字段的每次出现(或目标出现)。与 --updates 互斥。 |
| — | --group <name> | 字符串 | 目标字段组 — 请参阅上面的定位表格。 |
| — | --occurrence <index> | 整数 | --group 中的单次出现索引。请参阅上方的定位表格。 |
| — | --updates <json> | JSON 数组 | 批量处理的多次出现表单。请参阅上方的定位表格。 |
-m | --model-version <version> | 非负整数 | 开放式并发防护:审核预测所依据的模型版本(来自 get-predictions 的 ModelVersion)。如果此后重新训练生成了较新的版本,则系统会拒绝确认,而不会将偏移值标记为基本事实。省略可跳过检查。 |
示例
# Confirm a single document with a field filter and a correction
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
-f a7c3e9105f2b4d86,b2f8a01c7d3e6940 -c '[{"field_id":"a7c3e9105f2b4d86","value":"INV-7654321"}]'
# Confirm a single document with a field filter and a correction
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
-f a7c3e9105f2b4d86,b2f8a01c7d3e6940 -c '[{"field_id":"a7c3e9105f2b4d86","value":"INV-7654321"}]'
# Confirm all predicted fields on a document as-is
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21
# Confirm all predicted fields on a document as-is
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21
# Confirm every occurrence of a repeatable group
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 --group "Line Items"
# Confirm every occurrence of a repeatable group
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 --group "Line Items"
# Single occurrence
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
--group "Line Items" --occurrence 2
# Single occurrence
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
--group "Line Items" --occurrence 2
# Batched: confirm one field in two specific occurrences, in one atomic call
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
--group "Loan and Property" --updates '[{"occurrence":0,"fields":["e9b1746c0a2f5d83"]},{"occurrence":2,"fields":["e9b1746c0a2f5d83"]}]'
# Batched: confirm one field in two specific occurrences, in one atomic call
uip ixp labellings confirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
--group "Loan and Property" --updates '[{"occurrence":0,"fields":["e9b1746c0a2f5d83"]},{"occurrence":2,"fields":["e9b1746c0a2f5d83"]}]'
数据形状(--输出 json)
{
"Code": "IxpLabellingsConfirm",
"Data": { "ProjectName": "my-invoices", "TotalDocuments": 1, "PredictionsConfirmed": 1 }
}
{
"Code": "IxpLabellingsConfirm",
"Data": { "ProjectName": "my-invoices", "TotalDocuments": 1, "PredictionsConfirmed": 1 }
}
TotalDocuments / PredictionsConfirmed对文档进行计数,而不对字段进行计数( PredictionsConfirmed是指每个文档 0 或 1 — 这会保留旧版 CLI 每文档的合同,即使基础字段计数可能更高)。
uip IXP 标签未确认
从文档中删除确认 — 目标字段恢复为未批注状态。用于回滚错误的 confirm/mark-missing。文档中的所有其他批注均将结转。共享 confirm 的 --group/--occurrence/--updates 定位模型(请参见上表),减去 --corrections/--model-version。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
<document-id> | 是 | 文档 ID。 |
选项
| 短 | 长 | 值 | 描述 |
|---|---|---|---|
-f | --fields <field-ids> | 逗号分隔 | 要取消确认的字段 ID。 |
| — | --group <name> | 字符串 | 目标字段组。 |
| — | --occurrence <index> | 整数 | 单次出现索引。 |
| — | --updates <json> | JSON 数组 | 批量处理的多次出现表单:[{"occurrence":<n>,"fields"?:[...]}]。 |
其中至少需要 --fields/--group 之一——不允许隐式取消确认整个文档。
示例
uip ixp labellings unconfirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
-f a7c3e9105f2b4d86,b2f8a01c7d3e6940
uip ixp labellings unconfirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
-f a7c3e9105f2b4d86,b2f8a01c7d3e6940
uip ixp labellings unconfirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 --group "Line Items"
uip ixp labellings unconfirm my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 --group "Line Items"
数据形状(--输出 json)
{
"Code": "IxpLabellingsUnconfirm",
"Data": {
"ProjectName": "my-invoices",
"DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21",
"FieldsUnconfirmed": 2,
"Unmatched": []
}
}
{
"Code": "IxpLabellingsUnconfirm",
"Data": {
"ProjectName": "my-invoices",
"DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21",
"FieldsUnconfirmed": 2,
"Unmatched": []
}
}
uip IXP 标签标记缺失
将文档中的字段标记为缺失 — 批注为没有值且没有位置。当确实缺少该字段时使用。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
<document-id> | 是 | 文档 ID。 |
选项
| 短 | 长 | 值 | 必填 | 描述 |
|---|---|---|---|---|
-f | --fields <field-ids> | 逗号分隔 | 是 | 要标记为缺失的字段 ID。 |
示例
uip ixp labellings mark-missing my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
-f a7c3e9105f2b4d86,b2f8a01c7d3e6940
uip ixp labellings mark-missing my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21 \
-f a7c3e9105f2b4d86,b2f8a01c7d3e6940
数据形状(--输出 json)
{
"Code": "IxpLabellingsMarkMissing",
"Data": {
"ProjectName": "my-invoices",
"DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21",
"FieldsMarked": 2,
"Unmatched": []
}
}
{
"Code": "IxpLabellingsMarkMissing",
"Data": {
"ProjectName": "my-invoices",
"DocumentId": "5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21",
"FieldsMarked": 2,
"Unmatched": []
}
}
UIP IXP标签获取预测
获取项目中文档的 IXP 模型预测 — 预测的标签和字段值,加上产生它们的 ModelVersion(null 当文档尚无预测时)。
参数
| 名称 | 必填 | 用途 |
|---|---|---|
<project-name> | 是 | 项目名称。 |
[document-id] | 否 | 文档 ID。如果省略此选项,则会散布到项目中的每个文档 —已弃用。 |
示例
uip ixp labellings get-predictions my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21
uip ixp labellings get-predictions my-invoices 5f3a9c21-7e4b-4d8a-9f12-6c0b8e3d2a14.7f3c8a21
数据形状(--输出 json)
{
"Code": "IxpLabellingsGetPredictions",
"Data": { "ProjectName": "my-invoices", "TotalDocuments": 1, "DocumentsWithPredictions": 1, "Predictions": [] }
}
{
"Code": "IxpLabellingsGetPredictions",
"Data": { "ProjectName": "my-invoices", "TotalDocuments": 1, "DocumentsWithPredictions": 1, "Predictions": [] }
}
Predictions 条目保留 API 的原生帕斯卡命名法,包括每个标签的可重复组的 Occurrence 索引。
相关内容
- uip IXP — 概念和完整资源目录。
- uip IXP 项目—
get-metrics,以检查标注质量;publish以发布重新训练的模型。 - uip IXP 分类— 对此处的字段/组预测进行评分。