Instructions to use FaridBenamara/trocr-catmus-french-2026 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use FaridBenamara/trocr-catmus-french-2026 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
Configuration Parsing Warning:In adapter_config.json: "peft.task_type" must be a string
TrOCR + LoRA — HTR pour manuscrits médiévaux français (CATMuS)
Adaptateur LoRA spécialisant microsoft/trocr-base-handwritten
sur la transcription de lignes de manuscrits médiévaux français (XIIIᵉ s., gothique Textualis),
entraîné sur le sous-ensemble français de CATMuS Medieval.
Projet MD5 — Master Data/IA, HETIC (Vision par ordinateur & NLP).
Résultats (test scellé CATMuS FR complet, n=4135)
| Métrique | Valeur | IC 95 % (bootstrap) |
|---|---|---|
| CER | 14,51 % | [14,19 ; 14,85] |
| WER | 44,28 % | — |
| Baseline (sans fine-tuning) | CER 76,7 % | — |
Utilisation
from transformers import TrOCRProcessor, VisionEncoderDecoderModel
from peft import PeftModel
from PIL import Image
import torch
REPO = "FaridBenamara/trocr-catmus-french-2026" # cet identifiant
BASE = "microsoft/trocr-base-handwritten"
processor = TrOCRProcessor.from_pretrained(REPO)
base = VisionEncoderDecoderModel.from_pretrained(BASE)
tok = processor.tokenizer
for cfg in (base.config, base.generation_config):
cfg.decoder_start_token_id = tok.cls_token_id
cfg.pad_token_id = tok.pad_token_id
cfg.eos_token_id = tok.sep_token_id
base.config.vocab_size = base.config.decoder.vocab_size
model = PeftModel.from_pretrained(base, REPO).eval()
image = Image.open("ligne.png").convert("RGB")
pv = processor(images=[image], return_tensors="pt").pixel_values
ids = model.generate(pv, max_new_tokens=128)
print(processor.batch_decode(ids, skip_special_tokens=True)[0])
Entraînement
| Hyperparamètre | Valeur |
|---|---|
| Base | microsoft/trocr-base-handwritten (ViT + décodeur) |
| LoRA | r = 16, α = 32, dropout 0,05, cibles query/value/q_proj/v_proj |
| Params entraînés | 2 113 536 / 336 035 328 (0,63 %) |
| Optim | lr 1e-4, warmup 0,05, 3 epochs, batch 16, bf16 |
| Matériel | 1× A100 40 Go, ~50 min · seed 42 |
Convention semi-diplomatique (abréviations conservées, Unicode NFC).
SHA-256 du train : 11a7b277d73e53c540aba23fdd2f7533ea7068f790e16e4699a5d69fcc87c26c.
Limitations & biais
Biais 13ᵉ–15ᵉ s. / écriture Textualis ; WER élevé (une lettre fausse invalide le mot) ; qualité page-entière dépendante de la segmentation amont ; évaluation sur un échantillon de 500 lignes ; erreurs résiduelles sur lettres visuellement proches (c/e, n/u). Usage recherche non commerciale.
Citation
@misc{trocr_catmus_french_2026,
title = {TrOCR + LoRA pour la transcription de manuscrits médiévaux français (CATMuS)},
author = {Benamara, Farid and Megrad, Ouassim and Touat, Abdennour and Sellani, Khaled},
year = {2026},
note = {Master Data/IA, HETIC — Projet MD5},
howpublished = {Hugging Face Hub}
}
Dépôt code : TrOcr_NLP_HETIC_Vit_Nlp. Corpus : CATMuS/medieval.
- Downloads last month
- 4
Model tree for FaridBenamara/trocr-catmus-french-2026
Base model
microsoft/trocr-base-handwrittenDataset used to train FaridBenamara/trocr-catmus-french-2026
Evaluation results
- Character Error Rate (%) on CATMuS Medieval (French subset)self-reported14.510
- Word Error Rate (%) on CATMuS Medieval (French subset)self-reported44.280