(1) Overview
Repository location https://doi.org/10.5281/zenodo.21824878.
Context
Automatic Text Recognition (ATR)1 is currently employed across numerous projects in philology and the humanities, yielding outputs for textual analysis and data mining that were, until recently, inconceivable.2 Its efficiency relies heavily on available training data, while its versatility depends on generic models.
Regarding writings in the Arabic script, the Open Islamicate Texts Initiative (OpenITI) is notable for compiling datasets in Arabic as well as other Eastern languages written in the Arabic abjad (Nigst et al., 2020).3 Recent projects have extended ATR to manuscripts from the Western Islamicate world, focusing either on Arabic Maghrebi manuscripts (Vidal-Gorène et al., 2021, 2024)4 or on West African Ajami5 manuscripts, namely in Fulfulde, Hausa, and Wolof (Yousuf, Aminu, et al., 2026; Yousuf, Diagne, Høgel, et al., 2026)6 (see Table 1). The dataset Ibero-Romance Handwriting in Arabic Script (IRHAS) furthers these advancements by providing, for the first time, a documented ATR dataset for Spanish Ajami, more commonly known by its Spanish designation, Aljamiado.
Table 1
ATR datasets of Maghrebi and Ajami texts.
| NAME | LANGUAGE | PERIOD | TYPE | NB. OF DOCUMENTS | NB. OF PAGES | NB. OF LINES | ANNOTATION METHODOLOGY | DEPOSIT |
|---|---|---|---|---|---|---|---|---|
| RASAM 1 | Arabic | 18th–19th c. | Handwritten | 3 | 300 | 7,540 | (Vidal-Gorène et al., 2021) | https://github.com/calfa-co/rasam-dataset |
| TariMa | Arabic | 17th–19th c. | Handwritten, lithograph | 28 | 120 | 2,364 | https://github.com/calfa-co/tarima/tree/main/docs | |
| RASAM 2 | Arabic and Berber | 17th–19th c. | Handwritten | 15 | 250 | 3,750 | https://github.com/calfa-co/rasahttps://zenodo.org/records/21824878m-dataset | |
| Ajami Handwritten Text Recognition Dataset | Hausa | 20th c. | Handwritten, lithograph, printed | 24 | 344 | 5,337 | (Yousuf, Aminu, et al., 2026) | 10.5281/zenodo.15691685 |
| Fulfulde | 18th–20th c. | Handwritten | 5 | 56 | 797 | |||
| Wolof | 20th c. | Handwritten, printed | 19 | 313 | 4,743 | (Yousuf, Diagne, Høgel, et al., 2026) | ||
| IRHAS | Aragonese, Spanish, and Arabic | 15th–17th c. | Handwritten | 19 | 663 | 10,825 | 10.5281/zenodo.21824878 | 10.5281/zenodo.21824878 |
Textual production in Aljamiado emerged during the late Middle Ages in the northern Iberian kingdoms among Muslim populations living under Christian rule (Mudejars and later Moriscos). The corpus of surviving Aljamiado manuscripts – approximately 230 to 250 codices (Villaverde Amieva, 2010) – is estimated to date from the early 15th century to the early 17th century (Brisville-Fertin, 2020, Appendix B; Rodríguez Rodríguez, 1987; Wiegers, 1990, 1994, Appendix 1).7 Beyond adopting Andalusi habits for transcribing Romance languages, writing Spanish in the Arabic script required a graphical adaptation of the Arabic abjad, the most prominent requirement being full vocalisation (taškīl).8
IRHAS represents the initial outcome of a three-year endeavour aimed at extending ATR to Aljamiado and producing documented ground truth comprising 663 pages, 10,825 lines, and 550,299 characters in total from 19 distinct manuscripts (see Tables 1 and 2). The dataset can be used to train a fine-tuned generic ATR model for Aljamiado manuscripts, as discussed below.
Table 2
Composition of IRHAS dataset version 1.9
| CITY | INSTITUTION | CALL NUMBER | FOLIATION | TEXTUAL GENRE | PAGES | LINES | CHARACTERS | ESTIMATED DATE OF COPY |
|---|---|---|---|---|---|---|---|---|
| Cambridge | Cambridge University Library | Dd.9.49 | 1r–9v | Religious treatise | 20 | 476 | 35,046 | c. 1608 |
| Madrid | Biblioteca Nacional de España | MSS/4871 | 1v–11r | Religious narrative and sayings | 22 | 625 | 51,763 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5252 | 8v–28r | Religious treatise | 40 | 729 | 41,626 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5254 | 1v–21r | Narrative | 40 | 680 | 39,749 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5301 | 2r–14v | Narrative | 28 | 415 | 18,596 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5302 | 1r–24r | Religious polemic | 48 | 675 | 23,803 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5305 | 42v–61r | Narrative | 40 | 748 | 44,660 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5313 | 182r–195v | Narrative | 30 | 370 | 11,877 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | MSS/5354 | 1v–22r | Religious sayings | 42 | 620 | 23,404 | 1500–1599 |
| Madrid | Biblioteca Nacional de España | RES/247 | 1v–21r | Narrative poetry | 40 | 566 | 24,931 | 1500–1599 |
| Madrid | Bib. T. Navarro Tomás, CCHS–CSIC | Resc/1 | 1v–11r | Religious treatise | 20 | 343 | 13,074 | 1500–1599 |
| Madrid | Bib. T. Navarro Tomás, CCHS–CSIC | Resc/8 | 1v–10r | Religious narratives and sayings | 20 | 350 | 17,038 | 1500–1599 |
| Madrid | Bib. T. Navarro Tomás, CCHS–CSIC | Resc/53 | 189r–194r | Narrative | 11 | 214 | 12,549 | 1500–1599 |
| Madrid | Bib. T. Navarro Tomás, CCHS–CSIC | Resc/53 | 24v–28v | Religious narratives and sayings | 9 | 177 | 11,058 | 1500–1599 |
| Madrid | Bib. T. Navarro Tomás, CCHS–CSIC | Resc/55 | 21v–44r | Narrative | 46 | 411 | 11,305 | 1500–1599 |
| Madrid | Bib. T. Navarro Tomás, CCHS–CSIC | Resc/62 | 2r–11v | Religious treatise | 20 | 404 | 20,812 | 1500–1599 |
| New York | Columbia University, Rare Book & Manuscript Library | Or. 515 | 4v–14r | Religious treatise | 20 | 373 | 17,127 | c. 1589–1591 |
| Paris | Bibliothèque nationale de France | arabe 1163 | 5v–10v, 60v–65r, 113vr–117v | Religious treatise, sapiential poetry, sermon | 36 | 570 | 29,091 | before 1567 |
| Saragossa | Fondo Documental Histórico de las Cortes de Aragón | L528 | 1r–v, 2v–47v | Calendar treatise | 85 | 1,271 | 53,389 | 1500–1599 |
| Saragossa | Fondo Documental Histórico de las Cortes de Aragón | L528 | 115r–121v | Sermon | 12 | 185 | 7,670 | 1500–1599 |
| Saragossa | Fondo Documental Histórico de las Cortes de Aragón | L536 | 63v–72r | Narrative | 18 | 329 | 19,593 | c. 1481 |
| Saragossa | Fondo Documental Histórico de las Cortes de Aragón | L536 | 123r–131r | Religious polemic | 16 | 294 | 22,138 | c. 1481 |
(2) Method
The dataset was created using the eScriptorium user interface (Kiessling et al., 2019; Stokes et al., 2021), which operates on the Kraken engine (Kiessling, 2015, 2019). The 22 extracts from 19 distinct codices were exported in XML-ALTO format alongside digital images in .jpg or .png. The transcription guidelines are provided as a .pdf and a version of the below table as a .csv.
Steps and sampling strategy
The composition of the above dataset is accountably shaped by its two production phases:
Initial Phase: Guidelines were drafted10 in parallel with the creation of a core transcription ground truth consisting of five witnesses of a religious narrative and a calendar religious treatise. The transcription was carried out manually following a graphemic approach, yielding a first sub-corpus for IRHAS comprising five-manuscript extracts11 of 190 pages, 2,595 lines, 108,713 characters (indicated in bold in Table 2) that was reviewed according to established guidelines.
Extension Phase: Manuscript selection established a diversified sample of Aljamiado textual production based on estimated date of copying, graphic variation (see Figure 1), and textual genre.12 Owing to the scarcity of dated codices, graphic variation – followed by genre diversity – was prioritised when selecting extracts. The ACDC ATR model (Smith et al., 2023) was applied to predict the first four samples of this sub-corpus (indicated in italics in Table 2), each comprising approximately twelve folios (104 pages, 1,615 lines, 83,830 characters). An intermediary fine-tuning iteration of the ACDC baseline model using these nine corrected documents yielded significant efficiency gains, enabling the selection of longer extracts of twenty folios. Including 14 new manuscripts, the extension phase added 17 samples, comprising 473 pages, 8,230 lines, and 441,586 characters.

Figure 1
Samples of handwriting variation (details from BNE MSS/4871, BNE MSS/5252, BNE MSS/5301, BNE MSS/5302, BNE Res.247, CU Or. 515 Folio, CSIC Resc/1, CSIC Resc/8, CSIC Resc/62, CUL dd.9.49, FDHCA L536).
Except for one miscellany exhibiting highly heterogeneous hands (Paris, BnF, ar. 1163), the sampled documents consist of continuous manuscript passages ranging from unitary short pieces up to 20-folio extracts. The digitisations were downloaded from six institutions’ on-line repositories open for investigation purposes.13 Except for one bilingual text (Zaragoza, FDHCA, L536, f. 63v–72r), all the samples are written in Aljamiado (Aragonese-Castilian) with the usual brief Arabic insertions.
The segmentation of every image was reviewed and manually tagged following the SegmOnto principles (Gabay et al., 2023, 2024) – mainly, MainZone, MarginTextZone, and NumberingZone for the zones, and DefaultLine and InterlinearLine for the lines. The revision specifically included the line masks, which were manually adjusted to encompass all diacritics, prior to dataset evaluation.
All automatic predictions were corrected and subsequently underwent a second proofreading pass according to the following principles.
Transcription Guidelines
In line with other projects such as CATMuS (Clérice et al., 2024; Pinche et al., 2024),14 IRHAS adopts a graphemic approach to ensure transcription consistency and facilitate compatibility with other ATR projects targeting Arabic scripts, such as OpenITI or BasHTR.15
Consonants
Every letter is transcribed using a single Unicode character, regardless of its positional variant (cf. below final variants). Maghrebi fāʾ and qāf are transcribed using their dedicated code points: ڢ (U + 06A2) and ڧ (U + 06A7). Un-dotted letters are preserved: dotless bāʾ, tāʾ, ṯāʾ, nūn, as well as initial and medial yāʾ, correspond to ٮ (U + 066E); dotless fāʾ and qāf correspond to ڡ (U + 06A1); and dotless final nūn and yāʾ correspond to ں (U + 06BA) and ى (U + 0649), respectively. In cases of scribal dot corrections, the correction is followed. Crossed-out deletions are enclosed in curly braces {} and transcribed if legible. Insertion marks are transcribed as ‸ (U + 2038).
The following two principles need further discussion and assessment in future work:
Final variants may appear in non-syntactic or non-morphological boundary position (e.g.,كُنْ بِّلِرْ). As their regularisation relies on human interpretation and linguistic knowledge, they are transcribed by introducing a space after them.
Unvocalised final hāʾ may mark the end of Romance terms. This letter appears to evolve into simple hooks (Brisville-Fertin, 2020, Volume 1, § 3.3.1.1; Kadri, 2015, Volume 1, pp. 315–18), which, when distinguishable, are transcribed as ه (U + 0647) (see Figure 2). Although these are likely allographic variants (see Viguera Molins, 1982, 1993), especially in medial position, their transcription has been maintained in this dataset so that researchers remain or become aware of them and their status can be critically discussed for transcriptions, given their current omission in transliteration (cf. Kontzi, 1981).

Figure 2
Examples of final hāʾ and final hooks (details of BNE MSS/5252, BNE MSS/5301, BNE MSS/5354, CSIC Resc/55, CSIC Resc/62, CU Or.515 Folio, CUL dd.9.49, FDHCA L528, FDHCA L536).
Vowels and other combinatory characters
Because they are fundamental to Aljamiado, vocal diacritics are transcribed exactly as they appear in the manuscripts, as are šadda, dagger alif, and tanwīn (even when marking gemination). Corrections or ambiguities are also followed. Hamza is transcribed according to its contextual position (e.g., شَاىِٕدُ, ءَالْ مَئَاشْتُرُ, لُشَلْڢَڧِيءَاشْ). Combining character sequences are preferred over precomposed characters, i.e., ا / ى / و + ٔ (U + 0654) / ٕ (U + 0655) / ٓ (U + 0653). As an archaic or Qur’anic variant of waṣl, vowels attached directly to alif are transcribed as
(U + 0871),
(U + 0875), or
(U + 0872), depending on the position of the vowel stroke.
Punctuation, spacing, and abbreviations
Only the three-dot punctuation mark is transcribed: ؞ (U + 061E). Other graphical elements are ignored. When a graphical element conceals a textual correction, it is marked by curly braces. Visible spacing is intentionally preserved since Aljamiado exhibits highly heterogeneous writing habits; in ambiguous cases, word separation follows morphosyntactic boundaries. Standard separation is observed for the Arabic passages in this dataset version, but spacing should not be normalised in future work.16 Taṭwīl (U + 0640) is not used. Abbreviation marks are transcribed using a combined madda upon the letters (U + 0653).
Quality control
Every corrected transcription or prediction underwent a second review to ensure accuracy and consistency. The XML-ALTO files were validated online against a predefined control list using the Choco-Mufin on-line tool (Clérice, 2026; Clérice & Pinche, 2021) and converted to Unicode NFD normalisation form before evaluation.
(3) Dataset Description
Repository name
Zenodo (https://doi.org/10.5281/zenodo.21824878).
Object name
Ibero-Romance Handwriting in Arabic Script (IRHAS).
Format names and versions
.xml-ALTO (transcriptions), .png / .jpg (images), .pdf (transcription guidelines), .csv (dataset table)
Creation dates
2023-12–2026-08-01.
Dataset creator and contributor
Brisville-Fertin, Olivier (ENS de Lyon, UMR-5648 CIHAM): Conceptualization, Data Curation, Formal Analysis, Methodology, Supervision, Transcription, Validation, Writing – original draft.
Bensalah, Ryane (ENS de Lyon): Transcription.
Language
Old Spanish (Aragonese and Castilian), Arabic
Licence
CC-BY-NC-SA 4.0, for the dataset; licence of the images is specified in the description of the deposit.
Publication date
2026-08-06
(4) Results and Reuse Potential
The dataset was evaluated using a 5-fold cross-validation setup (Hastie et al., 2017, Chapter 7) with Kraken (version 7.1),17 in which four folds were used to fine-tune the ACDC base model while the remaining fold served as an evaluation subset.18 The folds were constructed from entire manuscript extracts and balanced to represent approximately one-fifth of the total dataset in terms of both lines and characters.
The resulting average Character Accuracy Rate (CAR) reaches 92.54% (see Table 3), which is comparable to other projects on Maghribi script (cf. Vidal-Gorène et al., 2024) – given the heterogeneity of word boundaries in Aljamiado, Word Accuracy Rate (WAR) does not seem relevant.19 To contextualise the current challenges posed by Aljamiado ATR, baseline results are presented for two available models for manuscripts in Arabic abjad: the ACDC model – trained on Arabic and Persian manuscripts (Smith et al., 2023) – and the Tarima model – trained on Maghrebi manuscripts (Bibliothèque Universitaire des Langues et Civilisations [BULAC], 2023). Such results may be partly explained by neither model accounting for vocal diacritics.
Table 3
Results of a 5-fold test of IRHAS.
| EVALUATIVE FOLD | PAGES | LINES | CHARACTERS | VALIDATION CAR | TEST CAR | ACDC CAR | TARIMA CAR |
|---|---|---|---|---|---|---|---|
| Fold 1 | 148 | 2,246 | 111,579 | 94.90% | 92.63% | 41.50% | 36.66% |
| Fold 2 | 151 | 2,358 | 104,652 | 94.60% | 92.96% | 44.94% | 39.87% |
| Fold 3 | 118 | 2,066 | 111,014 | 95.00% | 91.82% | 39.33% | 34.86% |
| Fold 4 | 116 | 2,014 | 109,574 | 95.00% | 92.62% | 42.36% | 37.95% |
| Fold 5 | 130 | 2,141 | 113,480 | 94.70% | 92.67% | 40.51% | 35.30% |
| Average | 133 | 2,165 | 110,059.8 | 94.84% | 92.54% | 41.73% | 36.93% |
This encouraging score demonstrates that a model can effectively generate acceptable raw transcriptions of Aljamiado texts, thereby facilitating downstream tasks such as dual transcribed-transliterated editions20 or conducting linguistic and textual analyses. I am deeply convinced that ATR, and more broadly Digital Humanities, holds the potential to renew our philological approaches to Aljamiado manuscripts.
An important caveat to highlight, nonetheless, is that masks were manually corrected in order to provide accurate data for training and to avoid inducing model hallucinations regarding diacritics: accuracy rates are therefore expected to be lower when using automatically generated masks.
However, a survey of the 41,076 total errors revealed that 19.99% (8,213) were strictly spacing errors – that is, missing or extraneous spaces – and 57.30% (23,538) were vocalisation and combinatory diacritic errors.21 The latter finding attests that consonant prediction is reliable in raw transcription and suggests that predicting only consonants might yield higher accuracy.
Moreover, this dataset can be reused within multilingual Arabic-script datasets, subject to appropriate character harmonisation, for which the transcription guidelines are documented. It will be a valuable addition for the Ajami texts from the Islamicate West.
The aspects of the guidelines designated for further assessment (i.e., final variants/spacing and final hāʾ/hooks) should ultimately be re-examined and potentially revised or discarded, according to their relevance.
Finally, an extension is currently planned to enrich the corpus with additional samples from Mudejar and Morisco manuscripts in both Aljamiado and Arabic (approximately 500 pages from 15 manuscripts); a second version is scheduled for release in late 2026 or early 2027.
To clarify the reuse potential of the IRHAS dataset, applications can be divided into immediate reuse and reuse requiring preprocessing or harmonisation:
Immediate reuse: The ground-truth dataset can be directly used to train a specific model, to fine-tune a generic baseline model, or to evaluate ATR models for Arabic scripts. A trained or fine-tuned model can be used to generate raw transcriptions as a basis for an editorial task or as an addition to on-line repositories of digitised manuscripts, as several libraries already offer. An evaluation of results remains necessary to assess potential uses for distant reading. Furthermore, the ground truth can already be exploited directly for linguistic and scribal analyses of Aljamiado practices and production.
Reuse after preprocessing or harmonisation: To ensure a better accuracy rate for editorial purposes, line masks should be checked and corrected if needed before launching the transcription prediction. To integrate the IRHAS dataset into a larger multilingual Arabic-script dataset, character mapping or harmonisation will likely be required, which is why the transcription guidelines are provided in detail. Performing downstream automated NLP tasks such as tokenisation, POS-tagging, or automated transliteration would necessitate prior normalisation of word boundaries, thereby opening up new avenues for fine-grained linguistic analyses of Aljamiado writing practices and language contact phenomena.
Notes
[1] As proposed by Pinche and Stokes (2024), the designation ATR covers both Optical Text Recognition (OCR) and Handwriting Text Recognition (HTR) since the distinction between them is blurred on a technological level.
[2] For instance, the CoMMA Project and its transcribed 33,000 manuscripts (Clérice et al., 2026).
[3] See also the webpage: https://github.com/OpenITI (last accessed: 11 August 2026). The OpenITI print corpus in its state of 2022-09-03 served to train a generic model (Kiessling, 2022). Models from Smith et al. (2023) are available in the repository at: https://github.com/OpenITI/acdc_results (last accessed: 11 August 2026).
[4] Three datasets are available: RASAM 1–2, https://github.com/calfa-co/rasam-dataset, (last accessed: 11 August 2026); and TARIMA, https://github.com/calfa-co/tarima, (last accessed: 11 August 2026).
[5] Ajami (Ar. ʿajamī, literally ‘foreign’ – that is, non-Arabic) refers to the adaptation and graphic use of the Arabic script for Islamicate vernacular languages.
[6] The three datasets are gathered in the same deposit in Yousuf, Diagne, Aminu, et al. (2026) at DOI: 10.5281/ZENODO.20392539
[7] The expulsions of the Moriscos in 1609–14 are an ad quem term for the use of Arabic script. See the syntheses by Viguera (1990), Montaner Frutos (2002) and Cervera Fras (2010).
[8] Beside the well-known description of the corresponding uses in any edition, see Montaner’s recent reflection (2026).
[9] DOI: 10.5281/zenodo.21824878.
[10] These guidelines were produced in the frame of a personal project of a bilingual edition of “The City of Brass”; the corresponding ground truth will also be made available in a subsequent release.
[11] Only four witnesses are included because of copyright authorisation; the fifth one will be released in an updated version 2. The texts were transcribed by Ryan Bensalah as part of her Master’s dissertations (2024, 2025) and internship under my supervision.
[12] Various typologies for Aljamiado manuscripts have been proposed (Bernabé Pons, 2010; Bouzineb, 1987; Brisville-Fertin, 2020, Section 3.3.2.1; Montaner Frutos, 1988).
[13] The Cambridge Digital Library: https://cudl.lib.cam.ac.uk/ (last accessed: 11 August 2026), under a CC BY-NC 4.0 licence according to the IIIF metadata; the Biblioteca Nacional de España Digital: https://bnedigital.bne.es/bd/es/simple (last accessed: 11 August 2026), under a CC BY 4.0 licence; the Biblioteca Virtual of CSIC: https://csic-primo.hosted.exlibrisgroup.com/primo-explore/search?vid=34CSIC_VU1 (last accessed: 11 August 2026), under a CC BY-NC-SA 4.0 licence; the Clio portal of Columbia University Libraries: https://clio.columbia.edu/catalog (last accessed: 11 August 2026), images free of known copyright restrictions and in the public domain; the Bibliothèque nationale de France Gallica portal: https://gallica.bnf.fr (last accessed: 11 August 2026), under a CC BY-NC licence; the Fondo Histórico de las Cortes de Aragón: https://www.cortesaragon.es/Fondo-historico.2926.0.html?&no_cache=1 (last accessed: 11 August 2026), under a CC BY-NC-ND 4.0 licence.
[14] See webpage of the project: https://catmus-guidelines.github.io/index.html (last accessed: 11 August 2026).
[15] See webpage: https://bnf.hal.science/BNF_DTL/page/projets-2026–2027 (last accessed: 11 August 2026). I thank Benjamin Kiessling and Mathew Barber for sharing their guidelines.
[17] https://github.com/mittagessen/kraken/releases (last accessed: 11 August 2026).
[18] Hyper-parameters for the training were the following: batch size of 16 with gradient accumulation over 2 batches (effective batch size: 32), Adam optimizer, learning rate 10–4, early quitting with lag fixed at 20 epochs, 32 bits precision, with default kraken data augmentation active. I thank Th. Clérice and M. Gille Levenson for their technical assistance in the testing process.
AI Declaration
After the redaction of the draft, the author used Gemini (Google) for linguistic revision and proofreading. The author reviewed and edited the content as necessary and takes full responsibility for the content of the publication.
Acknowledgements
I acknowledge Ryane Bensalah’s decisive contributions during the initial phase of this dataset and thank her for agreeing to work on Aljamiado material for her MA.
I also sincerely thank Thibault Clérice, Matthias Gille Levenson, and Ariane Pinche for their advice or their technical assistance, and the reviewers of this datapaper for their enriching comments.
This research benefited from the computing facilities of the Centre Blaise Pascal (ENS de Lyon), specifically for training and testing the automatic text recognition models.
Author Contributions
Olivier Brisville-Fertin: Conceptualization, Data Curation, Investigation, Methodology, Supervision, Validation, Writing – original draft.
