← All projects
Project record1 mention
Originally shared on Hacker News

OCR pipeline for a 45-volume book

This project is an OCR pipeline for digitizing a very large book of 45 volumes (~500 pages each) that contains margin comments and many footnotes. Pages are first processed with the Google Vision API, which returns JSON with each word and its bounding-box coordinates; that JSON is then fed to Gemini to identify page sections (headers, main text, margin comments, footnotes), and Gemini is also asked to write a Python script that groups word sections by coordinates so the script can be run against the OCR output. Work is ongoing to make the section-grouping script generalize across arbitrary pages, since footnote start positions vary and pages can be askew.

Last shared
01 / The problem

What it addresses

Plain OCR mingles margin comments and footnotes with the main text, resulting in gibberish, and a hard-coded script for section separation only works for the individual page it was written for.

02 / Source history

Shared over time

Each entry reflects what was shared on that date. Details may have changed since then.

  1. OCR pipeline for a 45-volume book

    This project is an OCR pipeline for digitizing a very large book of 45 volumes (~500 pages each) that contains margin comments and many footnotes. Pages are first processed with the Google Vision API, which returns JSON with each word and its bounding-box coordinates; that JSON is then fed to Gemini to identify page sections (headers, main text, margin comments, footnotes), and Gemini is also asked to write a Python script that groups word sections by coordinates so the script can be run against the OCR output. Work is ongoing to make the section-grouping script generalize across arbitrary pages, since footnote start positions vary and pages can be askew.

    Problem: Plain OCR mingles margin comments and footnotes with the main text, resulting in gibberish, and a hard-coded script for section separation only works for the individual page it was written for.

    Posted by @bambax · Original source ↗

    Source text · @bambax · · Source ↗

    I'm trying to OCR a very large book: 45 volumes of ~500 pages each. The digitization has been done (not very good but not too bad either), but the pages have comments in the margin and lots of footnotes. Just doing plain OCR doesn't really work because the notes in the margin and the footnotes get mingled with the text, which results in gibberish. But, when sent to Google Vision API, each page results in a json file that has an object for each word and the four coordinates of its bounding box.