Nutrient Data Extraction API 支持按 JSON Schema 提取并附带逐字段引用与置信度
Nutrient(原 PSPDFKit)的 Data Extraction API 可将 PDF、扫描件、图片和 Office 文件解析为空间 JSON 或 Markdown,并按自定义 JSON Schema 提取字段,每个值附带页码、边界框、match 标签和置信度。
MarkTechPost· Asif Razzaq·2026-11-19 11:23· 1 小时前AI 评分55
Nutrient 数据提取 API:按你的 Schema 输出 JSON,并附逐字段引用与置信度
AI 导读
Nutrient(原 PSPDFKit)的 Data Extraction API 可将 PDF、扫描件、图片和 Office 文件解析为空间 JSON 或 Markdown,每个字段附页码、边界框、match 标签和置信度。
正文 · 原文
当 LLM 把从文档中提取的错误值当作事实呈现给你时,这种错误代价高昂,尤其是在据此做决策时。 Nutrient Data Extraction API 正是针对这一问题。它可将 PDF、扫描件、图片和 Office 文件解析为空间 JSON 或 Markdown。Extract 会将文档中的字段映射到你的 JSON schema,而 split、classify 和 form 端点则为你的文档流水线提供实用的基础能力。每个提取出的值都通过边界框、match 标签和置信度分数锚定到某一页。Nutrient(原 PSPDFKit)在 MCP server、agent skill、Mac app 和 SDK 背后运行着同一套引擎。
TL;DR
- 规模: 托管 API,含 4 种解析模式及自动路由。
- 运行于: Nutrient 云、通过 SDK 运行在你自己的服务器上,或 Apple silicon Mac。
- 试用入口: Studio,一个浏览器工作区,用于配置和测试解析、提取、分类、拆分和表单填写。
- 性能: 在 Nutrient 的 WholeDoc Bench 上总体得分 86.2,在 19 种设置中排名第一(live API、Agentic)。
- 最佳: 每页 1.8¢ 时得分 86.2,而最佳前沿模型设置为每页 17.8¢ 时得分 67.1。
如何在写代码前在 Studio 中测试?
Studio 是 Nutrient 的浏览器工作区,用于在将 API 集成到你的应用之前配置和测试它。它让你能在自己的文件上测试解析、提取、分类、拆分和表单填写。典型流程:
- 上传示例文档并设置你计划发送的参数。
- 在 UI 中起草 schema,或根据你自己的文档生成一个。
- 在新文档上运行,然后检查值和引用。
- 将设置保存为带版本的预设。API 将其称为 processor,带有 proc_ ID。
- 在评估集中用最多 25 份已审核文档对预设版本打分。
在 Studio 中保存的 processor 之后可通过 ID 从 API 调用。
应该选择哪种模式?
Auto 会将每一页路由到 structure、understand 或 agentic。如果省略模式,API 默认使用 understand。
| 操作 | 最适合 | 每页价格 | 每页提取 | WholeDoc Bench* |
| Parse: text | 原生数字 PDF 和 Office 文件,无需 OCR | $0.001 | $0.007** | 未测试 |
| Parse: structure | 针对简单版式的扫描件进行 OCR,不使用 AI | $0.0015 | $0.0075 | 39.4 |
| Parse: understand | AI 版式分析:表单、复杂版式 | $0.009 | $0.015 | 80.8 |
| Parse: agentic | 视觉语言模型:手写体、退化扫描件、图表 | $0.018 | $0.024 | 86.2 |
| Classify | 零样本文档标签 | $0.001 | n/a | n/a |
| Split | 将合并的 PDF 拆分为多个文档 | $0.003 | n/a | n/a |
*WholeDoc Bench 解析得分,2026 年 11 月 5 日;并非提取准确率。Extract 每页额外收费 $0.006。**API 文档列出 text 模式提取;agent skill 从 structure 开始。
定价以美元计,来自 Nutrient 云 API 共享的 1 个余额,因此团队可以自由组合搭配。免费计划每月提供 5 美元用量,约可覆盖 330 次 understand 模式提取。Starter 每月 75 美元,包含 90 美元用量;Growth 每月 275 美元,包含 345 美元用量。
grounded confidence 是如何工作的?
在 Nutrient 的置信度文章中,某个字段得分为 0.97,但来自错误的列。
当前得分是可选信号的综合值:token 概率、候选边际、grounding 和格式。Nutrient 的 NLI grounding 模型以 Apache-2.0 开源。一个 grounded 值仍可能对应错误的字段。当不存在得分时,置信度会被省略,而不是记为低分。
每个字段还会获得一个匹配标签:id_match、id_match_multiblock、id_match_partial、fuzzy_match 或 not_found。先根据标签做门控,再看置信度。
import json, requests
API_KEY = "your_api_key"
schema = {
"type": "object",
"properties": {
"invoice_number": {"type": "string", "description": "Invoice number below the supplier details."},
"total_amount": {"type": "number", "description": "Printed final total including tax. Not the subtotal."},
},
"required": ["invoice_number", "total_amount"],
}
instructions = {"schema": schema, "parseConfig": {"mode": "understand"},
"options": {"includeCitations": True}}
with open("invoice.pdf", "rb") as f:
r = requests.post(
"https://api.nutrient.io/extraction/extract",
headers={"Authorization": f"Bearer {API_KEY}"},
files={"file": ("invoice.pdf", f, "application/pdf"),
"instructions": (None, json.dumps(instructions), "application/json")},
timeout=300,
)
r.raise_for_status()
out = r.json()["output"]
data, metadata = out.get("data") or {}, out.get("metadata") or {}
EXACT = {"id_match", "id_match_multiblock"}
THRESHOLD = 0.97 # illustrative only; evaluate on representative documents
for field in schema["properties"]: # loop over expected fields so none skip review
value = data.get(field)
meta = metadata.get(field) or {}
match, conf = meta.get("match"), meta.get("confidence") # None = no score
passes = (value is not None and match in EXACT
and conf is not None and conf >= THRESHOLD)
print(field, value, match, conf, "page", meta.get("pageNumber"),
"PASSES_BASIC_CHECKS" if passes else "REVIEW")
此演示仅覆盖扁平 schema;生产环境需要类型和业务规则检查。0.97 的门槛对应 Nutrient 抵押贷款教程中的金额字段。
classify 和 split 是如何工作的?
一个文档决策模型为 classify 和 split 提供支持。Nutrient 报告 split F1 为 96.2%,而 Typesafe AI 的 Jev 为 63.7%。
agent 如何使用它?
托管的 MCP 服务器无需 API key。Claude Code 用 1 条命令即可连接:
claude mcp add --transport http --scope user nutrient https://mcp.nutrient.io/mcpClaude 和 Codex 也可通过 OAuth 使用。默认 agentic 模式的解析成本为每页 0.018 美元。
编码 agent 可以通过 npx skills add pspdfkit-labs/nutrient-skills –skill document-extraction-api 安装 document-extraction-api skill。
它能在本地运行吗?
在 Mac 应用上,只有使用本地模型时文档才会留在本地。完全离线的生产环境需要 SDK。
它在 WholeDoc Bench 上的得分如何?

Nutrient 新的 WholeDoc Bench 评估整份文档,而非单页:480 份文档、30 多种语言、7 个领域。
| 设置 | 总体 | 表格 | 图表 | 位置 | 美分/页 |
| Nutrient Agentic | 86.2 | 87.1 | 64.5 | 88.6 | 1.8 |
| Nutrient Understand | 80.8 | 86.1 | 35.1 | 86.4 | 0.9 |
| Claude Fable 5.1(高 effort) | 67.1 | 84.7 | 58.9 | 66.0 | 17.8 |
| Azure Document Intelligence | 65.9 | 69.4 | 0 | 72.5 | ≈2.8 |
| GPT-6.1 Sol(中 effort) | 62.9 | 82.8 | 47.6 | 49.3 | ≈3.1 |
| Extend(性能) | 60.5 | 80.8 | 40.6 | 75.2 | 2.0 |
| Reducto(R-1) | 59.9 | 76.4 | 38.5 | 76.4 | ≈1.7 |
| LlamaParse Agentic Plus | 56.7 | 89.5 | 0* | 65.4 | ≈5.6 |
| AWS Textract | 49.9 | 71.4 | 0 | 70.0 | 1.5 |
| Docling | 40.0 | 63.9 | 20.2 | 0 | 本地 |
选定行,WholeDoc 排行榜,2026 年 11 月 5 日,标价。*得分仍在审核中。
跨页连续性是最主要的差距。在 44 份包含跨页表格的文档上,19 个设置中有 15 个很少能保持表格完整。
Nutrient 构建并运行了它,主要测试集为私有。代码为 Apache-2.0,附带 10 份文档的公开样本。
关键要点
- 字段携带页码、区域、匹配标签,以及可用时的置信度。
- 在编写任何 API 代码之前,先在 Studio 中配置和测试。
- Understand 模式提取的成本为每 1,000 页 15 美元。
- Agentic 在 Nutrient 的 WholeDoc Bench 上以每页 1.8 美分的成本位居榜首,得分 86.2。
- 图表仍然困难:64.5 是 WholeDoc 图表最高分。
参见 Data Extraction API、基准测试、MCP 服务器和 GitHub 上的 agent skill。
感谢 Nutrient AI 团队为本文提供的思想领导力/资源。本文为赞助内容。
文章营养数据提取 API:按你的 Schema 输出 JSON,并附逐字段引用与置信度首次发表于MarkTechPost。
来源:MarkTechPost · marktechpost.com
来源:RadarAI · aihot.news