Read-only mirror of https://github.com/eth-library/ChronoQuill — ETH Library. Issues & pull requests at the source.
  • Python 98.9%
  • Shell 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-01 13:26:05 +02:00
supplements readMe & license update 2026-01-23 13:01:24 +01:00
.gitignore adding preliminary dockerfile 2026-01-23 10:20:19 +01:00
chrono_quill.py adding thinking budget and setting Gemini 3.0 as standard 2026-04-01 13:26:05 +02:00
LICENSE readMe & license update 2026-01-23 13:01:24 +01:00
prompts.py refactoring 2025-11-19 14:31:58 +01:00
readMe.md update ReadMe 2026-02-20 12:21:46 +01:00
setup.sh update ReadMe, add setup.sh 2026-02-20 12:14:34 +01:00
utils.py adding preliminary dockerfile 2026-01-23 10:20:19 +01:00

ChronoQuill

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.

chronoQuill

Setup Instructions

git clone git@github.com:eth-library/ChronoQuill.git
cd ChronoQuill

Environment and Libraries

uv 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 dotenv

Environment Variables

Create a .env file in the project root and add your Gemini API key:

GEMINI_API_KEY=your_api_key_here

Classifier & Few-Shot Samples

chmod u+x setup.sh && ./setup.sh

Project Structure

  • chrono_quill.py — Main pipeline script
  • utils.py — Utility functions and helper classes
  • prompts.py — System prompts for Gemini API
  • few_shot/ — Few-shot ground truth samples
  • models/ — Pretrained model files
  • data/ — Input and output data

Transform TIFF & JPG into Markdown

python chrono_quill.py

License

We release ChronoQuill under the Apache 2.0 license.

References

Remarks

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.

Citation

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}
}