QWEN2.5-VL - French Parish Register Model

Introduction

This version of QWEN2.5-VL-7B is specialized for HTR on French parish records from the 16th-18th centuries. Ref: https://redmine.teklia.com/issues/11177

Training

The model is a QWEN2.5-VL-7B-Instruct fine-tuned on French parish records using LoRA.

It was fine-tuned in two steps:

  1. First, it was fine-tuned on 30k crowdsourced records (annotations of variable quality) → DAI-CReTDHI-RecordGeneanet-ATR
  2. It was then fine-tuned on 7k records (high quality annotation) → DAI-CReTDHI-RecordGold-ATR

Parameters:

  • Image width: 1500 pixels (max)
  • LoRa rank: 8
  • LoRa alpha: 32
  • Epochs: 10 (about 4k steps)

Wandb: https://wandb.ai/starride-teklia/uncategorized/runs/bjv98gfo

Evaluation

It achieves the following results:

Overall evaluation

Model CER (%) WER (%) NLS (%)
Qwen-2.5 7B VL 44.10 73.77 56.67
Qwen-3 8B VL 62.06 85.42 39.20
Qwen-3.5 9B VL 44.56 67.58 56.70
Churro-3B 22.24 36.26 79.87
Gemma4 55.49 85.75 46.21
Claude Opus 4.5 20.15 39.58 80.78
Mistral OCR 41.35 76.48 61.02
Gemini 3.0 Pro 16.31 33.47 84.25
Qwen-2.5 7-B VL (fine-tuned on gold data) 14.89 29.27 90.91
Qwen-2.5 7-B VL (fine-tuned on crowdsourced data) 11.41 24.24 -
Qwen-2.5 7-B VL (fine-tuned on crowdsourced and gold data) 9.24 21.25

Per period evaluation

Model Period CER (%) WER (%) NLS (%) N images
Qwen-2.5 7B VL < 1600 76.74 99.78 24.38 13
1600 - 1650 57.33 89.14 43.19 169
1650 - 1700 37.98 69.69 62.76 162
1700 - 1750 39.59 68.48 60.91 210
1750 - 1800 47.02 70.64 53.39 204
Qwen-3 8B VL < 1600 99.85 100.0 0.15 13
1600 - 1650 81.82 98.88 18.9 169
1650 - 1700 52.25 78.67 48.89 162
1700 - 1750 59.5 82.17 42.06 210
1750 - 1800 59.0 80.92 42.32 204
Qwen-3.5 9B VL < 1600 89.96 98.05 13.03 13
1600 - 1650 66.58 87.65 34.8 169
1650 - 1700 39.4 63.79 61.84 162
1700 - 1750 31.84 56.44 68.81 210
1750 - 1800 39.7 59.89 61.13 204
Churro-3B < 1600 36.12 55.1 66.38 13
1600 - 1650 23.23 40.72 77.41 169
1650 - 1700 20.04 35.47 80.9 162
1700 - 1750 21.41 32.51 79.15 210
1750 - 1800 31.75 41.16 69.57 204
Gemma4 < 1600 115.4 137.96 22.34 13
1600 - 1650 124.85 137.53 22.7 169
1650 - 1700 77.2 106.59 40.97 162
1700 - 1750 63.26 101.87 44.84 210
1750 - 1800 70.96 99.36 43.95 204
Claude Opus 4.5 < 1600 68.5 104.99 46.62 13
1600 - 1650 34.33 60.6 68.1 169
1650 - 1700 21.84 42.87 79.4 162
1700 - 1750 19.95 38.13 80.96 210
1750 - 1800 14.17 31.39 86.24 204
Mistral OCR < 1600 95.9 145.55 23.19 13
1600 - 1650 65.71 107.68 38.86 169
1650 - 1700 44.73 83.86 59.43 162
1700 - 1750 38.31 72.84 63.45 210
1750 - 1800 33.53 65.03 67.9 204
Gemini 3.0 < 1600 53.91 84.82 50.87 13
1600 - 1650 28.65 54.02 72.17 169
1650 - 1700 19.27 37.74 81.41 162
1700 - 1750 14.17 29.63 86.33 210
1750 - 1800 12.07 27.13 88.33 204
Qwen-2.5 7-B VL (fine-tuned on crowdsourced and gold data) < 1600 31.2 50.11 71.95 13
1600 - 1650 15.77 30.5 84.79 169
1650 - 1700 8.91 20.45 91.26 162
1700 - 1750 8.82 20.18 91.32 210
1750 - 1800 7.19 18.88 92.87 204

Usage

Here we show a code snippet to show you how to use the model with transformers and qwen_vl_utils:

  • Prediction script
from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
from qwen_vl_utils import process_vision_info
import torch

# Load QWEN
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    "Teklia/Qwen2.5-VL-7B-DAI-CReTDHI-RecordGold-ATR",
    torch_dtype=torch.bfloat16,
    attn_implementation="flash_attention_2",
    device_map="auto",
)
processor = AutoProcessor.from_pretrained("Teklia/Qwen2.5-VL-7B-DAI-CReTDHI-RecordGold-ATR", use_fast=True)

# Prompt
messages = [
    {
        "role": "system",
        "content": [
           {
               "type": "text",
               "text": "Tu es un assistant archiviste. Tu dois lire des actes issus de registres paroissiaux français, du 16è au 18è siècle. Extrais le texte de la marge, du corps de l'acte, et éventuellement les signatures."
           }
        ]
    },
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "https://europe.iiif.teklia.com/iiif/2/geneanet%2FArdennes_BMS%2F382706%2F00056.jpg/1252,102,1133,692/full/0/default.jpg"
            },
            {
                "type": "text",
                "text": "Extrais le texte de ce document."
            },
        ],
    }
]

# Preparation for inference
text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)
image_inputs, video_inputs = process_vision_info(messages)
inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
)
inputs = inputs.to("cuda")

# Inference: Generation of the output
generated_ids = model.generate(**inputs, max_new_tokens=1024)
generated_ids_trimmed = [
    out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]
output_text = processor.batch_decode(
    generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
)[0]
print(output_text)
  • Output
L'an mil sept cent quatre vingt six le dix septième jour du mois de mars est décédé à Frainvrit de cette paroisse Lambert Joseph Henrot âgé de trente huit ans, natif de Gumiay fils de Lambert Henrot et de Marie Thérèse Gervant lequel a été inhumé le lendemain au cimetière de cette ditte paroisse avec les ceremonies ordinaires par nous prêtre vicaire de cette ville, en présence de Vincent Parrot fleure de cette église, et de Piacre Blondeau, habitant de cette ville, lesquels ont signé avec nous.

Blondeau Parrot Berin vicaire

Citation

To cite the original QWEN2.5-VL model:

@misc{qwen2.5-VL,
    title = {Qwen2.5-VL},
    url = {https://qwenlm.github.io/blog/qwen2.5-vl/},
    author = {Qwen Team},
    month = {January},
    year = {2025}
}
Downloads last month
4
Safetensors
Model size
8B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Datasets used to train Teklia/Qwen2.5-VL-7B-DAI-CReTDHI-RecordGold-ATR

Collection including Teklia/Qwen2.5-VL-7B-DAI-CReTDHI-RecordGold-ATR