Image-to-Text
Transformers
Safetensors
qwen3_5
image-text-to-text
ocr
table-recognition
document-understanding
Instructions to use lschiemanowski/tablereader-lightonocr-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lschiemanowski/tablereader-lightonocr-v0 with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "image-to-text" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("image-to-text", model="lschiemanowski/tablereader-lightonocr-v0")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("lschiemanowski/tablereader-lightonocr-v0") model = AutoModelForMultimodalLM.from_pretrained("lschiemanowski/tablereader-lightonocr-v0", device_map="auto") - Notebooks
- Google Colab
- Kaggle
File size: 2,627 Bytes
7cfeac5 9c06f0f 7cfeac5 9c06f0f 7cfeac5 9c06f0f 7cfeac5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | ---
license: apache-2.0
base_model: lightonai/LightOnOCR-3-4B
library_name: transformers
pipeline_tag: image-to-text
tags:
- ocr
- table-recognition
- document-understanding
datasets:
- lschiemanowski/scannedtables
---
# tablereader-lightonocr-v0
[LightOnOCR-3-4B](https://huggingface.co/lightonai/LightOnOCR-3-4B) fine-tuned to transcribe a crop of a printed
table into a fixed HTML format: a `# Title` line when a title is printed, a table with `thead` for printed
column headings, `data-level` for the printed indentation of row labels, `<sup>` for footnote markers and
`tfoot` for footnote lines ([transcription format](https://github.com/lschiemanowski/tablereader/blob/main/docs/transcription-format.md),
contract revision 1).
It is the model behind [tablereader](https://github.com/lschiemanowski/tablereader), which detects the tables
in a PDF, crops them over their titles and footnotes, runs this model, and converts the transcription into
table JSON. `release.json` records the settings the model was trained with: crop preparation, renderer,
detector, image size and generation settings. Use it through tablereader so crops are prepared the same way:
```bash
uv run tablereader read report.pdf --pages 13-20
```
## Prompt
The image alone, with no system prompt or text, scaled so its longest edge is at most 2048 pixels; thinking
disabled, temperature 0, up to 16,000 new tokens.
## Training
LoRA (rank 16, alpha 32) on every language-model projection, the vision encoder frozen; 3 epochs at learning
rate 1e-4 on 995 table crops from 107 publication series (UK public-sector reports, US federal and historical
statistics, German budget annexes and others), digital and scanned. The targets are GPT-6.1 Terra
transcriptions that parse into tables without blocking issues; they were not reviewed by a person. The training
crops include some that the [scannedtables](https://huggingface.co/datasets/lschiemanowski/scannedtables)
dataset holds back for rights or privacy reasons. The adapter is merged into the bf16 weights.
## Evaluation
1,006 validation crops from series not seen in training, scored as the share of printed values whose row path,
column path and text match the reference transcription exactly (metric `records-1`):
| All | Digital PDFs | Scans |
| ---: | ---: | ---: |
| 0.797 | 0.835 | 0.511 |
72% of crops are read without a difference. The model does not yet answer `NOT_A_TABLE` for crops without a
table, and scans read much worse than digital PDFs. A self-training round on 7,698 of its own
transcriptions did not improve these scores.
## License
Apache 2.0, as the base model.
|