Views
No views yet
| 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 |
| 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 |
transformers and qwen_vl_utils:1from transformers import Qwen2_5_VLForConditionalGeneration, AutoTokenizer, AutoProcessor
2from qwen_vl_utils import process_vision_info
3import torch
4
5# Load QWEN
6model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
7 "Teklia/Qwen2.5-VL-7B-DAI-CReTDHI-RecordGold-ATR",
8 torch_dtype=torch.bfloat16,
9 attn_implementation="flash_attention_2",
10 device_map="auto",
11)
12processor = AutoProcessor.from_pretrained("Teklia/Qwen2.5-VL-7B-DAI-CReTDHI-RecordGold-ATR", use_fast=True)
13
14# Prompt
15messages = [
16 {
17 "role": "system",
18 "content": [
19 {
20 "type": "text",
21 "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."
22 }
23 ]
24 },
25 {
26 "role": "user",
27 "content": [
28 {
29 "type": "image",
30 "image": "https://europe.iiif.teklia.com/iiif/2/geneanet%2FArdennes_BMS%2F382706%2F00056.jpg/1252,102,1133,692/full/0/default.jpg"
31 },
32 {
33 "type": "text",
34 "text": "Extrais le texte de ce document."
35 },
36 ],
37 }
38]
39
40# Preparation for inference
41text = processor.apply_chat_template(
42 messages, tokenize=False, add_generation_prompt=True
43)
44image_inputs, video_inputs = process_vision_info(messages)
45inputs = processor(
46 text=[text],
47 images=image_inputs,
48 videos=video_inputs,
49 padding=True,
50 return_tensors="pt",
51)
52inputs = inputs.to("cuda")
53
54# Inference: Generation of the output
55generated_ids = model.generate(**inputs, max_new_tokens=1024)
56generated_ids_trimmed = [
57 out_ids[len(in_ids) :] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
58]
59output_text = processor.batch_decode(
60 generated_ids_trimmed, skip_special_tokens=True, clean_up_tokenization_spaces=False
61)[0]
62print(output_text)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@misc{qwen2.5-VL,
title = {Qwen2.5-VL},
url = {https://qwenlm.github.io/blog/qwen2.5-vl/},
author = {Qwen Team},
month = {January},
year = {2025}
}