| Books | Genres | Tokens | Entity mentions | Entity types | Nested | IAA $\kappa$ |
|---|---|---|---|---|---|---|
| 138 | 10 | 876K | 78,530 | 21 | 18.96% | 0.938 |
Most studies on Arabic Named Entity Recognition (NER) have focused on news texts and social media posts, while the large and rich corpus of literary Arabic books has been underrepresented. We introduce AdabNER, the first large-scale nested NER dataset for Modern Standard Arabic (MSA) literary texts, comprising the first 6,000 words annotated from each of 138 books spanning ten literary genres, including history, biography, literary criticism, and travel literature, and covering works from the 1880s to the 2020s. The corpus comprises about 876K tokens, manually annotated using a nested 21 entity tag annotation scheme, yielding 78,530 entity mentions, 18.96% of which are nested. We fine-tuned five pre-trained Arabic BERT encoders in two settings: stratified and leave-book-out, achieving F1 scores of 0.86 and 0.83 with AraBERTv2, respectively. We also evaluated five large language models through few-shot in-context learning, including open-source models and the closed-source Gemini 3 Pro, with Gemini 3 Pro achieving the highest LLM F1 score of 0.59. Supervised results degraded under out-of-domain evaluation; however, joint multi-domain training reduced this gap to less than a 1% F1 loss, demonstrating that domain-diverse training data is key to robust Arabic NER, though broader validation beyond the experiments reported is needed. AdabNER and its annotation guidelines are publicly available at https://doi.org/10.5281/zenodo.19468385.
The dataset is currently undergoing final processing and will be released soon. For non-commercial research use only — see License.
| AdabNER corpus + guidelines | doi.org/10.5281/zenodo.19468385 |
| Best model (AraBERTv2) — coming soon | huggingface.co/aiamourad/AdabNER |
| Wojood (OOD experiments) | sina.birzeit.edu/wojood |
Place splits under data/adabner/ and data/wojood/ before running experiments.
| Source | Hindawi Library digital collection |
| Sampling | 1 book per genre per decade; first 6,000 words after removing front matter |
| Taxonomy | 18 OntoNotes types + OCC / CURR / UNIT → 21 types |
| Nesting framework | Wojood & ACE nested annotation framework |
Biographies · Geography · History · Literary Criticism · Literature · Novels · Philosophy · Politics · Social Sciences · Travel Literature
| Books | 138 (1 per genre per decade) |
| Sentences | 26,162 · ~189 per book · mean 33.5 words |
| Tokens | ~876K |
| Entity mentions | 78,530 |
| Nested entities | 14,082 (18.96%) |
| Max nesting depth | 3 |
| Same-type nesting | <1% (handled with B-ORG, B-ORG_2 indexing) |
AdabNER frames nested NER as a multi-label token classification task. Each token's contextual representation from the BERT encoder passes through a dropout layer ($p = 0.1$) and a single linear classification head with sigmoid activation over $43$ BIO labels ($21$ entity types $\times \{\mathrm{B}, \mathrm{I}\}$, plus $\mathrm{O}$). Because the labels are predicted independently rather than through a softmax, a token may carry several active labels at once, which is what allows overlapping mentions to be recovered in a single forward pass. The rare cases of same-type nesting (under $1\%$ of mentions) are resolved with indexed labels such as B-ORG and B-ORG_2.
Five Arabic encoders are fine-tuned under both the stratified and leave-book-out splits. The objective is focal loss, chosen to counter the severe class imbalance introduced by the BIO scheme and the long tail of entity types. Each configuration is run across three random seeds, and reported scores are the mean over those runs.
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW |
| Learning rate | $6 \times 10^{-5}$ |
| Batch size | $16$ |
| Max sequence length | $512$ |
| Loss | Focal loss ($\alpha = 0.75$, $\gamma = 1.0$) |
| Decision threshold | $0.5$ |
| Epochs | $50$, early stopping (patience $= 5$) on validation macro-$F_1$ |
| Seeds | $\{42, 1, 123\}$ |
| Hardware | $3 \times$ NVIDIA RTX A6000 (48 GB) |
The large language models are evaluated under a $5$-shot setting, with demonstrations drawn through stratified diverse example selection to cover the entity taxonomy. Models are prompted to return structured JSON and decoded greedily (temperature $= 0$). Open-source models are served with vLLM (tensor parallelism $= 8$) on A100-80GB GPUs, while Gemini 3 Pro and Qwen3-235B are queried asynchronously through Vertex AI.
bert/ train_adabner.py # BERT: 5 encoders × 2 splits × 3 seeds
llm/ eval_cohere.py # ICL: aya-expanse-32b, c4ai-command-r (vLLM)
eval_gemini.py # ICL: Gemini 3 Pro (Vertex AI async)
eval_qwen.py # ICL: Qwen2.5-72B (vLLM)
eval_qwen_235b.py # ICL: Qwen3-235B (Vertex AI async)
ood/ eval_wojood.py # Train Wojood → zero-shot transfer to AdabNER
eval_adabner_on_wojood.py # AdabNER model → zero-shot transfer to Wojood
mmd_analysis.py # MMD domain shift analysis
joint/ train_joint.py # Joint training: AdabNER + Wojood
src/ model.py dataset.py metrics.py preprocessing.py llm_utils.py
data/ adabner/ wojood/
pip install -r requirements.txt
All scripts run from the repository root:
python bert/train_adabner.py # BERT experiments
python llm/eval_gemini.py # LLM ICL
python ood/eval_wojood.py # OOD evaluation
python joint/train_joint.py # Joint training
Results written to results/.
| Model | Split | Micro P | Micro R | Micro $F_1$ | Macro $F_1$ |
|---|---|---|---|---|---|
| AraBERTv2 | Stratified | 0.85±.003 | 0.87±.003 | 0.86±.003 | 0.83±.006 |
| AraBERTv2 | Leave-Book-Out | 0.82±.014 | 0.85±.004 | 0.83±.006 | 0.81±.007 |
| ARBERTv2 | Stratified | 0.82±.007 | 0.85±.002 | 0.83±.004 | 0.81±.006 |
| ARBERTv2 | Leave-Book-Out | 0.79±.019 | 0.83±.011 | 0.81±.005 | 0.78±.006 |
| AraBERTv1 | Stratified | 0.80±.007 | 0.82±.003 | 0.81±.005 | 0.78±.011 |
| CAMeLBERT | Stratified | 0.79±.006 | 0.81±.006 | 0.80±.006 | 0.78±.008 |
| ARBERT | Stratified | 0.76±.011 | 0.80±.006 | 0.79±.008 | 0.75±.015 |
| Model | Split | Micro P | Micro R | Micro $F_1$ | Macro $F_1$ |
|---|---|---|---|---|---|
| Gemini 3 Pro | Leave-Book-Out | 0.55±.009 | 0.64±.020 | 0.59±.007 | 0.57±.005 |
| Gemini 3 Pro | Stratified | 0.59±.007 | 0.49±.040 | 0.53±.026 | 0.51±.023 |
| Qwen3-235B | Leave-Book-Out | 0.30±.012 | 0.53±.003 | 0.38±.009 | 0.35±.021 |
| Qwen2.5-72B | Leave-Book-Out | 0.30±.020 | 0.53±.004 | 0.38±.017 | 0.35±.026 |
| aya-expanse-32b | Stratified | 0.32±.013 | 0.44±.013 | 0.37±.006 | 0.32±.009 |
| c4ai-command-r | Stratified | 0.22±.008 | 0.38±.007 | 0.27±.004 | 0.24±.003 |
LLMs struggle with nested Arabic: fine-tuned encoders dominate ($F_1 = $ 0.86) vs. the best LLM ($F_1 = $ 0.59).
| Setting | Test Set | Micro $F_1$ |
|---|---|---|
| AdabNER → AdabNER | AdabNER | 0.860 |
| Joint → AdabNER | AdabNER | 0.853 |
| Wojood → AdabNER | AdabNER | 0.590 |
| Wojood → Wojood | Wojood | 0.920 |
| Joint → Wojood | Wojood | 0.921 |
| AdabNER → Wojood | Wojood | 0.660 |
Joint training solves domain collapse. Cross-domain transfer drops from 0.86 to 0.66 due to temporal and lexical shifts; joint training recovers cross-domain performance to within $<1\%$ $F_1$ of in-domain on both datasets.
All results averaged over 3 seeds. Full tables in the paper.
@inproceedings{mourad-jarrar-2026-adabner,
title = "{A}dab{NER}: {A}rabic Digital Archive Books with Nested Entity Recognition",
author = "Mourad, Aya and Jarrar, Mustafa",
booktitle = "Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
month = jul,
year = "2026",
address = "San Diego, California, United States",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.acl-long.1541/",
pages = "33382--33396",
ISBN = "979-8-89176-390-6",
}
This work was supported by the Sorbonne Center for Artificial Intelligence (SCAI) and the SOUND.AI project, funded by the European Union's Horizon programme.
The AdabNER dataset is for non-commercial research use only.
The corpus is derived from the Hindawi Books digital collection. The Hindawi Foundation has granted explicit permission to publish this dataset for non-commercial research purposes, with the following conditions:
The code in this repository is released under the MIT License.
| Books | Genres | Tokens | Entity mentions | Entity types | Nested | IAA $\kappa$ |
|---|---|---|---|---|---|---|
| 138 | 10 | 876K | 78,530 | 21 | 18.96% | 0.938 |
Most studies on Arabic Named Entity Recognition (NER) have focused on news texts and social media posts, while the large and rich corpus of literary Arabic books has been underrepresented. We introduce AdabNER, the first large-scale nested NER dataset for Modern Standard Arabic (MSA) literary texts, comprising the first 6,000 words annotated from each of 138 books spanning ten literary genres, including history, biography, literary criticism, and travel literature, and covering works from the 1880s to the 2020s. The corpus comprises about 876K tokens, manually annotated using a nested 21 entity tag annotation scheme, yielding 78,530 entity mentions, 18.96% of which are nested. We fine-tuned five pre-trained Arabic BERT encoders in two settings: stratified and leave-book-out, achieving F1 scores of 0.86 and 0.83 with AraBERTv2, respectively. We also evaluated five large language models through few-shot in-context learning, including open-source models and the closed-source Gemini 3 Pro, with Gemini 3 Pro achieving the highest LLM F1 score of 0.59. Supervised results degraded under out-of-domain evaluation; however, joint multi-domain training reduced this gap to less than a 1% F1 loss, demonstrating that domain-diverse training data is key to robust Arabic NER, though broader validation beyond the experiments reported is needed. AdabNER and its annotation guidelines are publicly available at https://doi.org/10.5281/zenodo.19468385.
The dataset is currently undergoing final processing and will be released soon. For non-commercial research use only — see License.
| AdabNER corpus + guidelines | doi.org/10.5281/zenodo.19468385 |
| Best model (AraBERTv2) — coming soon | huggingface.co/aiamourad/AdabNER |
| Wojood (OOD experiments) | sina.birzeit.edu/wojood |
Place splits under data/adabner/ and data/wojood/ before running experiments.
| Source | Hindawi Library digital collection |
| Sampling | 1 book per genre per decade; first 6,000 words after removing front matter |
| Taxonomy | 18 OntoNotes types + OCC / CURR / UNIT → 21 types |
| Nesting framework | Wojood & ACE nested annotation framework |
Biographies · Geography · History · Literary Criticism · Literature · Novels · Philosophy · Politics · Social Sciences · Travel Literature
| Books | 138 (1 per genre per decade) |
| Sentences | 26,162 · ~189 per book · mean 33.5 words |
| Tokens | ~876K |
| Entity mentions | 78,530 |
| Nested entities | 14,082 (18.96%) |
| Max nesting depth | 3 |
| Same-type nesting | <1% (handled with B-ORG, B-ORG_2 indexing) |
AdabNER frames nested NER as a multi-label token classification task. Each token's contextual representation from the BERT encoder passes through a dropout layer ($p = 0.1$) and a single linear classification head with sigmoid activation over $43$ BIO labels ($21$ entity types $\times \{\mathrm{B}, \mathrm{I}\}$, plus $\mathrm{O}$). Because the labels are predicted independently rather than through a softmax, a token may carry several active labels at once, which is what allows overlapping mentions to be recovered in a single forward pass. The rare cases of same-type nesting (under $1\%$ of mentions) are resolved with indexed labels such as B-ORG and B-ORG_2.
Five Arabic encoders are fine-tuned under both the stratified and leave-book-out splits. The objective is focal loss, chosen to counter the severe class imbalance introduced by the BIO scheme and the long tail of entity types. Each configuration is run across three random seeds, and reported scores are the mean over those runs.
| Hyperparameter | Value |
|---|---|
| Optimizer | AdamW |
| Learning rate | $6 \times 10^{-5}$ |
| Batch size | $16$ |
| Max sequence length | $512$ |
| Loss | Focal loss ($\alpha = 0.75$, $\gamma = 1.0$) |
| Decision threshold | $0.5$ |
| Epochs | $50$, early stopping (patience $= 5$) on validation macro-$F_1$ |
| Seeds | $\{42, 1, 123\}$ |
| Hardware | $3 \times$ NVIDIA RTX A6000 (48 GB) |
The large language models are evaluated under a $5$-shot setting, with demonstrations drawn through stratified diverse example selection to cover the entity taxonomy. Models are prompted to return structured JSON and decoded greedily (temperature $= 0$). Open-source models are served with vLLM (tensor parallelism $= 8$) on A100-80GB GPUs, while Gemini 3 Pro and Qwen3-235B are queried asynchronously through Vertex AI.
bert/ train_adabner.py # BERT: 5 encoders × 2 splits × 3 seeds
llm/ eval_cohere.py # ICL: aya-expanse-32b, c4ai-command-r (vLLM)
eval_gemini.py # ICL: Gemini 3 Pro (Vertex AI async)
eval_qwen.py # ICL: Qwen2.5-72B (vLLM)
eval_qwen_235b.py # ICL: Qwen3-235B (Vertex AI async)
ood/ eval_wojood.py # Train Wojood → zero-shot transfer to AdabNER
eval_adabner_on_wojood.py # AdabNER model → zero-shot transfer to Wojood
mmd_analysis.py # MMD domain shift analysis
joint/ train_joint.py # Joint training: AdabNER + Wojood
src/ model.py dataset.py metrics.py preprocessing.py llm_utils.py
data/ adabner/ wojood/
pip install -r requirements.txt
All scripts run from the repository root:
python bert/train_adabner.py # BERT experiments
python llm/eval_gemini.py # LLM ICL
python ood/eval_wojood.py # OOD evaluation
python joint/train_joint.py # Joint training
Results written to results/.
| Model | Split | Micro P | Micro R | Micro $F_1$ | Macro $F_1$ |
|---|---|---|---|---|---|
| AraBERTv2 | Stratified | 0.85±.003 | 0.87±.003 | 0.86±.003 | 0.83±.006 |
| AraBERTv2 | Leave-Book-Out | 0.82±.014 | 0.85±.004 | 0.83±.006 | 0.81±.007 |
| ARBERTv2 | Stratified | 0.82±.007 | 0.85±.002 | 0.83±.004 | 0.81±.006 |
| ARBERTv2 | Leave-Book-Out | 0.79±.019 | 0.83±.011 | 0.81±.005 | 0.78±.006 |
| AraBERTv1 | Stratified | 0.80±.007 | 0.82±.003 | 0.81±.005 | 0.78±.011 |
| CAMeLBERT | Stratified | 0.79±.006 | 0.81±.006 | 0.80±.006 | 0.78±.008 |
| ARBERT | Stratified | 0.76±.011 | 0.80±.006 | 0.79±.008 | 0.75±.015 |
| Model | Split | Micro P | Micro R | Micro $F_1$ | Macro $F_1$ |
|---|---|---|---|---|---|
| Gemini 3 Pro | Leave-Book-Out | 0.55±.009 | 0.64±.020 | 0.59±.007 | 0.57±.005 |
| Gemini 3 Pro | Stratified | 0.59±.007 | 0.49±.040 | 0.53±.026 | 0.51±.023 |
| Qwen3-235B | Leave-Book-Out | 0.30±.012 | 0.53±.003 | 0.38±.009 | 0.35±.021 |
| Qwen2.5-72B | Leave-Book-Out | 0.30±.020 | 0.53±.004 | 0.38±.017 | 0.35±.026 |
| aya-expanse-32b | Stratified | 0.32±.013 | 0.44±.013 | 0.37±.006 | 0.32±.009 |
| c4ai-command-r | Stratified | 0.22±.008 | 0.38±.007 | 0.27±.004 | 0.24±.003 |
LLMs struggle with nested Arabic: fine-tuned encoders dominate ($F_1 = $ 0.86) vs. the best LLM ($F_1 = $ 0.59).
| Setting | Test Set | Micro $F_1$ |
|---|---|---|
| AdabNER → AdabNER | AdabNER | 0.860 |
| Joint → AdabNER | AdabNER | 0.853 |
| Wojood → AdabNER | AdabNER | 0.590 |
| Wojood → Wojood | Wojood | 0.920 |
| Joint → Wojood | Wojood | 0.921 |
| AdabNER → Wojood | Wojood | 0.660 |
Joint training solves domain collapse. Cross-domain transfer drops from 0.86 to 0.66 due to temporal and lexical shifts; joint training recovers cross-domain performance to within $<1\%$ $F_1$ of in-domain on both datasets.
All results averaged over 3 seeds. Full tables in the paper.
@inproceedings{mourad-jarrar-2026-adabner,
title = "{A}dab{NER}: {A}rabic Digital Archive Books with Nested Entity Recognition",
author = "Mourad, Aya and Jarrar, Mustafa",
booktitle = "Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
month = jul,
year = "2026",
address = "San Diego, California, United States",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.acl-long.1541/",
pages = "33382--33396",
ISBN = "979-8-89176-390-6",
}
This work was supported by the Sorbonne Center for Artificial Intelligence (SCAI) and the SOUND.AI project, funded by the European Union's Horizon programme.
The AdabNER dataset is for non-commercial research use only.
The corpus is derived from the Hindawi Books digital collection. The Hindawi Foundation has granted explicit permission to publish this dataset for non-commercial research purposes, with the following conditions:
The code in this repository is released under the MIT License.