---
license: apache-2.0
language:
- ar
task_categories:
- image-to-text
tags:
- htr
- ocr
- arabic
- manuscripts
- historical
size_categories:
- 1K
## Dataset Description
TariMa is a specialized dataset designed to support Handwritten Text Recognition (HTR) and Optical Character Recognition (OCR) for historical Maghrebi Arabic documents.
This dataset serves as a complementary resource to the RASAM ([RASAM 1](https://huggingface.co/datasets/calfa-ai/RASAM-1) + [RASAM 2](https://huggingface.co/datasets/calfa-ai/RASAM-2)) dataset, focusing on specific vocabularies and document types—such as chronicles, travelogues, and biographical dictionaries—that were previously underrepresented. Images vary significantly in resolution (982 px to 8,049 px width), layout complexity (single/multiple columns), and preservation state.
This HuggingFace dataset provides **cropped line-level images** paired with their transcriptions and rich metadata for **26 Maghrebi Arabic documents** — both manuscripts and lithographed editions — including historical chronicles, travelogues, and biographical dictionaries. It is designed as a ready-to-use resource for Arabic Maghrebi HTR and OCR.
| | |
|---|---|
| Documents | 26 |
| Pages | 103 |
| Lines | 2,285 |
| Words | 26,469 |
| Characters | 138,001 |
> The full page-level dataset (PageXML + full-page images) is available on [GitHub](https://github.com/calfa-co/tarima).
## Source Documents
Documents from three French institutions, spanning both manuscripts and lithographed editions:
- **BULAC** — Bibliothèque universitaire des langues et civilisations (Paris)
- Manuscripts: `BULAC_MS_ARA_410`, `BULAC_MS_ARA_427`, `BULAC_MS_ARA_436C`, `BULAC_MS_ARA_453`, `BULAC_MS_ARA_794`
- Lithographies: `BULAC_RES_MON_4_3416`, `BULAC_RES_MON_4_3423`, `BULAC_RES_MON_4_3424`, `BULAC_RES_MON_8_3955`, `BULAC_RES_MON_8_4352`, `BULAC_RES_MON_8_4734`, `BULAC_RES_MON_8_5336`, `BULAC_RES_MON_8_5560`, `BULAC_RES_MON_8_6212`, `BULAC_RES_MON_8_7199`, `BULAC_RES_MON_8_8967`
- **BnF** — Bibliothèque nationale de France (Paris)
- `BnF-2297_btv1b11001977p`, `BnF-4617_btv1b10030580s`, `BnF-6898_btv1b10030178f`, `BnF-7024_btv1b10031132f`, `BnF-7214_btv1b10031231c`
- **MMSH / IREMAM** — Maison Méditerranéenne des Sciences de l'Homme (Aix-en-Provence)
- `MMSH_IREMAM_ARA_MS_011`, `MMSH_MS_050`, `MMSH_MS_051_1`, `MMSH_MS_051_2`, `MMSH_MS_056`
## Usage
```python
from datasets import load_dataset
# Load the full dataset
ds = load_dataset("calfa-ai/tarima")
# Access a sample
sample = ds["train"][0]
sample["image"].show()
print(sample["transcription"])
# Filter by support type
manuscripts = ds["train"].filter(lambda x: x["support_type"] == "manuscript")
lithographies = ds["train"].filter(lambda x: x["support_type"] == "lithography")
```
## Transcription Guidelines (Summary)
The transcription guidelines follow the RASAM specification: transcriptions preserve the text as found in the image, including variant spellings, while excluding vocalization marks unless structurally significant. See [RASAM 1](https://huggingface.co/datasets/calfa-ai/RASAM-1) and [original paper](https://link.springer.com/chapter/10.1007/978-3-030-86198-8_19) for details.
## Citation
```bibtex
@inproceedings{2024rasam-dataset,
title = {{Enhancing Arabic Maghribi Handwritten Text Recognition with RASAM 2: A Comprehensive Dataset and Benchmarking}},
author = {Vidal-Gorène, Chahan and Salah, Clément and Lucas, Noëmie and Decours-Perez, Aliénor and Perrier, Antoine},
url = {https://enc.hal.science/hal-04722622},
booktitle = {{Computational Humanities Research (CHR)}},
address = {Aarhus, Denmark},
volume = {3834},
pages = {200--216},
year = {2024},
month = dec,
}
```
## License
This dataset is released under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
## Acknowledgements
The TariMa dataset was developed through the TariMa project (*Tārīḫ al-Maġrib*), funded by the French agency CollEx-Persée. The project was conducted under the supervision of Antoine Perrier (CNRS) in collaboration with the BULAC, the Maison Méditerranéenne des Sciences de l'Homme, IREMAM, and Calfa.