Step-by-step guide to fine-tuning and deploying the Donut (Document Understanding Transformer) model for OCR-free document parsing using Hugging Face Transformers and Amazon SageMaker. Covers loading the SROIE scanned receipts dataset, preprocessing images and text into Donut-compatible format, uploading data to S3, launching a SageMaker training job with the HuggingFace Estimator, deploying the model to a SageMaker endpoint with a custom inference script, and evaluating results using ROUGE scoring. The fine-tuned model achieves an 81.7% ROUGE-1 score on the test set.

6m read timeFrom philschmid.de
Post cover image
Table of contents
Quick intro: Document Understanding Transformer (Donut) by ClovaAI1. Setup Development Environment2. Load SROIE dataset3. Preprocess and upload dataset for Donut4. Fine-tune Donut model on Amazon SageMaker5. Deploy Donut model on Amazon SageMaker