ChronoQuill's transformation pipeline leverages AI-powered HTR, layout classification, and few-shot learning to convert handwritten documents into structured Markdown. The indexing model is here on Hugging Face. For more technical details, access the working paper here.
git clone git@github.com:eth-library/ChronoQuill.git
cd ChronoQuilluv venv chrono
source chrono/bin/activate
uv pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
uv pip install google-genai timm dotenvCreate a .env file in the project root and add your Gemini API key:
GEMINI_API_KEY=your_api_key_here
chmod u+x setup.sh && ./setup.shchrono_quill.py— Main pipeline scriptutils.py— Utility functions and helper classesprompts.py— System prompts for Gemini APIfew_shot/— Few-shot ground truth samplesmodels/— Pretrained model filesdata/— Input and output data
python chrono_quill.pyWe release ChronoQuill under the Apache 2.0 license.
The pipeline is specialized to process ETH's school council protocols. For different use cases, consider pretraining your own classifier and provide suitable grount truth for few-shot learning.
If you use this pipeline in your work, please cite:
@article{marbach2026closed,
title={Closed-Vocabulary Multi-Label Indexing Pipeline for Historical Documents},
author={Marbach, Jeremy},
year={2026},
publisher={ETH Zurich},
url={https://www.research-collection.ethz.ch/server/api/core/bitstreams/8053d4d8-51b4-4103-8164-b5068ddb3903/content}
}