跳到正文
Google AI:DEV 作者專屬· Laurent Picard·· 9 天前AI 評分45

Gemini 如何比較文件

🎞️ How to compare documents

AI 導讀

Gemini 示範如何以原生多模態能力,在單一提示詞中比較複雜文件的兩個版本,包括數碼 PDF 與掃描文件。提示詞模板要求逐段逐字核對,找出錯字、標點及數字、日期、名稱等差異,並列出位置、兩份文件的引文和簡短説明。

正文

Cover image for 🎞️ How to compare documents

Google AI profile image Laurent Picard

🍿 Just a moment #02

Have you ever had to compare two versions of a complex document? What if one is a digital PDF and the other is a scan, spanning hundreds of pages, with different layouts and pagination? In this episode, see how Gemini’s native multimodality spots subtle differences, from tiny typos to $100M contract updates, in a single prompt.

Possible prompt template (used in the video):

<DOCUMENT_A>
…
</DOCUMENT_A>
<DOCUMENT_B>
…
</DOCUMENT_B>

TASK:
Perform an exhaustive, character-by-character textual comparison between DOCUMENT_A and DOCUMENT_B.

CRITICAL REQUIREMENTS:
1. You must systematically verify every numbered paragraph sequentially from start to finish.
2. You must catch every single difference, including single-character changes, minor typos, spelling corrections (e.g., missing letters in common words), and punctuation changes, in addition to substantive changes (numbers, dates, names).

OUTPUT FORMAT:
Difference #[1, 2, 3…]
Location: [location]
Evidence A: "[short quote from Document A]" with difference in *bold*
Evidence B: "[short quote from Document B]" with difference in *bold*
Explanation: [brief description]

More


來源:Google AI:DEV 作者專屬 · dev.to