PyLaia PyTorch atr htr ocr historical handwritten image-to-text no dataset:Teklia/NorHand_v2 license:mit region:us
---
library_name: PyLaia
license: mit
tags:
- PyLaia
- PyTorch
- atr
- htr
- ocr
- historical
- handwritten
metrics:
- CER
- WER
language:
- 'no'
datasets:
- Teklia/NorHand_v2
pipeline_tag: image-to-text
---

# PyLaia - NorHand v2

This model performs Handwritten Text Recognition in Norwegian. It was developed during the [HUGIN-MUNIN project](https://hugin-munin-project.github.io/).

## Model description

The model was trained using the PyLaia library on the [NorHand v2 dataset](https://zenodo.org/records/10555698).

Training images were resized with a fixed height of 128 pixels, keeping the original aspect ratio.

| split | N lines | N horizontal lines |
| ----- | ------: | -----------------: |
| train | 146,693 |            145,061 |
| val   |  15,119 |             14,980 |
| test  |   1,830 |              1,793 |

An external 6-gram character language model can be used to improve recognition. The language model is trained on the text from the NorHand v2 training set.

## Evaluation results

The model achieves the following results:

| set   | Language model | CER (%)    | WER (%) | N lines   |
|:------|:---------------| ----------:| -------:|----------:|
| test  | no             | 3.82       |   12.00 |     1,573 |
| test  | yes            | 3.13       |    9.29 |     1,573 |

## How to use?

Please refer to the [documentation](https://atr.pages.teklia.com/pylaia/).

## Cite us!

```bibtex
@inproceedings{pylaia-lib,
    author = "Tarride, Solène and Schneider, Yoann and Generali, Marie and Boillet, Melodie and Abadie, Bastien and Kermorvant, Christopher",
    title = "Improving Automatic Text Recognition with Language Models in the PyLaia Open-Source Library",
    booktitle = "Submitted at ICDAR2024",
    year = "2024"
}
```