Training#
The pretrained models work well on common printed documents. When your documents are different (another language, handwriting, unusual fonts, specific layouts, fields to extract), fine-tuning a model on a few hundred annotated samples usually brings a large improvement.
The workflow#
- Collect and annotate a representative sample of your documents, e.g. with the docTR Labeler.
- Format the data as an
images/folder and alabels.jsonfile, following the format of each task. - Train with the reference script of the task, starting from the pretrained weights.
- Evaluate the checkpoint on held-out data with the evaluation script.
- Load your checkpoint into a predictor, alongside the pretrained models.
- Share it on the Hugging Face Hub, if you like.
In this section#
Datasets
Built-in public datasets, synthetic data generators and loaders for your own data.
Training a model
Data formats, training scripts, multi-GPU and mixed precision, for every task.
Using your trained models
Load your checkpoints into the OCR, KIE and task-specific predictors.
Sharing models
Publish and load models with the Hugging Face Hub, and browse community models.