跳到主要内容Skip to main content
← 深水指南Guides

PDF 表格抽取Extract PDF tables

提示词与工作流Prompts & workflows · 提示词案例Prompt case

给定表格文本与字段 schema,输出 rows 并标注无法确认的单元格。

Given table text and a field schema, output rows and mark cells that cannot be confirmed.

提示词效果未实测。Prompt effect has not been tested.

提示词是可复跑的模板,不是效果承诺。换模型、换版本、换输入都可能改变结果;用本页的检查点自己核对,并把官方出处当作机制依据而不是效果保证。A prompt is a re-runnable template, not a promise of results. Changing the model, version or input can change the outcome. Use the checkpoints on this page to verify it yourself, and treat the official sources as evidence of mechanism rather than a guarantee of effect.

任务与输入Task and inputs

把 PDF 表格抽成可核对的结构化 rows。 输入:PDF 转出的表格文本、字段清单、页码或表号。

Given table text and a field schema, output rows and mark cells that cannot be confirmed. Inputs: Table text exported from the PDF, a field list, and page or table number.

提示词本体The prompt

你是表格抽取助手。只依据输入表格文本,按字段 {fields} 输出 JSON rows。每个单元格附 source_text;看不清或跨行合并无法确认时填 null 并在 issues 说明。不得补全原文没有的数字。

占位符用 {字段} 标注,运行前替换为本次输入。

You are a table extraction assistant. Use only the supplied table text and output JSON rows for {fields}. Attach source_text to each cell; use null and explain in issues when a cell is unclear or merged rows cannot be confirmed. Do not invent numbers absent from the source.

Replace {field} placeholders with the current inputs before running.

预期输出形态Expected output shape

JSON:rows[]、issues[];每行字段与 schema 一致。

JSON with rows[] and issues[]; each row matches the schema.

检查点Checkpoints

  • 每个非空单元格能在 source_text 找到原文。
  • null 单元格都有 issues 原因。
  • 行数与表头/合计行核对,不吞行。
  • Every non-empty cell can be found in source_text.
  • Every null cell has an issue reason.
  • Row count is checked against headers or totals; no rows are silently dropped.

失败分支Failure branches

  • 字段错位:先固定表头映射,再重跑。
  • 大量 null:改换 PDF 导出方式或人工补录,不猜值。
  • Misaligned fields: fix header mapping first, then rerun.
  • Many nulls: change the PDF export method or enter manually; do not guess.

出处与边界Sources and limits

提示词效果未实测。机制依据见出处;换模型、版本或输入会改变结果。

This site has not tested the effect of this prompt. See the sources for the mechanism; changing model, version or input can change the result.

出处Sources

来源Source链接URL
OpenAI Cookbook · Introduction to Structured Outputs(官方仓库 raw,2026-11-07 直抓 200)OpenAI Cookbook: Introduction to Structured Outputs (official repository raw, fetched 200 on 2026-11-07)https://raw.githubusercontent.com/openai/openai-cookbook/main/examples/Structured_Outputs_Intro.ipynbhttps://raw.githubusercontent.com/openai/openai-cookbook/main/examples/Structured_Outputs_Intro.ipynb

资料快照日期:2026-11-07;单项复核范围与日期见对应正文或来源记录。产品功能与条款可能变化,使用前请核对原始来源。Source snapshot: 2026-11-07; item-specific rechecks and their scope are recorded in the text or source notes. Features and terms may change; check the original sources before use.