Qikuyueser.com

Turning a PDF contract into a clause table

Added 2026-10-29

Turning a PDF contract into a clause table — Chinese original prompt

你是写过文档解析脚本的工程师。手上有 [合同份数与页数] 份 PDF 合同,格式包含 [扫描件、双栏排版、页眉页脚、跨页表格],需要用 [Python/Node] 在 [本地/内网] 跑一遍,抽出条款编号、标题、义务方、触发条件、期限,存成 [CSV/JSON]。请:1)判断哪些页必须先 OCR,哪些能直接取文本层,说明怎么快速判别;2)给一个按条款编号切分的规则,写清正则以及跨页时怎么合并;3)设计输出字段和一行样例,页码必须保留,方便回查原文;4)对抽不出或可疑的条目不要猜,标成待人工确认并写明原因;5)给一个用三份合同抽样验收的方法,核对抽出的条款数与原文目录是否一致;6)说明扫描件识别错字的常见位置和校验办法。验收:随机抽 20 条都能对上原文页码,漏抽和错抽逐条记录在案。
Site original

Chinese original

Replace these placeholders 5

Swap the bracketed parts for your own details before sending.

  • [合同份数与页数]
  • [扫描件、双栏排版、页眉页脚、跨页表格]
  • [Python/Node]
  • [本地/内网]
  • [CSV/JSON]
How to use

先跑三份看抽全率,再批量跑,别一上来处理两百份。

Try tweaking it

  • Have it restate requirements and constraints before writing code.
  • Ask for the smallest change plus a rollback path, not a full-file rewrite.

What you should get

  • A minimal, runnable change with copy-ready code
  • Impact list: which files and call sites must follow

Common mistakes

  • Asking it to touch ten files at once, then losing track of what broke what.
  • Pasting only the error, with no code or version, and getting an unfixable answer.

How to check the output

  • The change runs, can be rolled back, and touches nothing unrelated.
  • Edge cases (empty, oversized, concurrent) are covered or explained.

Where it works

  • Good for: having it restate requirements and constraints, then propose the smallest runnable change.
  • Watch out: include versions and a minimal reproduction with the error, or the fix may look plausible but not fit.

More in this topic