arXiv:2610.37265cs.CLOct 2026

Manuscript Offprint

arXiv:2610.37265

REGLAT at ArGuard Shared Tasks: An Ensemble-Based Model Integrating NER for Harmful Content Detection in Arabic

Ahmed M. Fetouh, Mariam Labib, Nsrin Ashraf, Omer Dawood, Hamada Nayel

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Detecting harmful content in Arabic is challenging because of dialectal variations and the semantic overlap between different harm categories. This paper presents a two-stage approach for classifying Arabic user prompts into seven categories of harmful content. First, GLiNER is used to extract harm-related entities from each prompt. The extracted entities are then added to the original text and passed to a fine-tuned MARBERT classifier for final classification. The approach combines explicit entity information with the contextual understanding of a pretrained Arabic language model. The system was evaluated on the development set of the ArGuard 2026 shared task. The results achieved a macro-F1 score of 0.886 and an accuracy of 0.897, demonstrating promising performance in fine-grained harmful content detection. The system reported an accuracy of 0.793 and Macro-F score of 0.735 on a blind test set for subtask 1. For subtask 2, it achieved an accuracy of 0.770 and Macro-F score of 0.754. The analysis also showed that distinguishing between related categories remains challenging. These findings suggest that integrating NER with Arabic language models is a promising approach to harmful content detection.

1 Introduction

The rapid adoption of large language models (LLMs) and conversational artificial intelligence has increased the importance of detecting harmful content in user prompts. Although these systems provide valuable capabilities for information retrieval, content generation, and interactive assistance, they may also encounter prompts involving violence, self-harm, harassment, bullying, hate speech, fraud, and adult content. Reliable harmful content detection is therefore essential for improving the safety and responsible use of language technologies. However, identifying harmful content remains challenging, particularly in Arabic, where dialectal variation, informal expressions, and context-dependent meanings can complicate automated classification (Ashraf et al., 2025, 2022; Nayel et al., 2021).

Fine-grained harmful content detection presents additional challenges beyond distinguishing between safe and unsafe text. Systems must identify the specific category of harmful content expressed in a prompt, even when different categories share similar vocabulary or semantic characteristics. For example, bullying, harassment, and hate speech may all involve offensive language or threats, while self-harm and harm to others may share references to violence or physical injury. Furthermore, a prompt may contain potentially harmful entities without explicitly expressing harmful intent, making it necessary to consider both the words used and their surrounding context. Class imbalance can further complicate this task, as models may perform unevenly across categories with different numbers of training examples (Nayel, 2020).

Transformer-based language models have demonstrated their usefulness in text classification by learning contextual representations from large-scale pretraining. MARBERT is relevant to Arabic text because its pretraining includes Modern Standard Arabic and dialectal Arabic data (Abdul-Mageed et al., 2021). Nevertheless, contextual representations may not always capture sufficiently explicit entity-level information needed to distinguish among harmful content categories. Named entity recognition (NER) offers a complementary approach by identifying relevant entities and expressions, such as weapons, self-injury references, sensitive financial information, and offensive expressions (Eldouby et al., 2026). Integrating these extracted entities into a classification pipeline may provide additional structured cues to support fine-grained decisions.

This paper presents our system for Subtask B2 of ArGuard 2026 (Alam et al., 2026), which combines GLiNER-based entity extraction with a fine-tuned MARBERT classifier. Harm-related entities are first extracted and transformed into a structured representation that is appended to the original prompt. The enriched input is then classified by MARBERT into one of seven harmful-content categories. By integrating explicit entity information with contextual language representations, the approach improves category discrimination. While achieving strong results on categories such as adult content and hate speech, error analysis reveals persistent confusion among semantically similar classes, particularly harm to others, bullying, and harassment, highlighting the ongoing challenge of fine-grained harmful content detection in Arabic.

The main contributions of this work are as follows:-

  • It presents a two-stage framework that integrates generalist NER with Arabic transformer-based classification for fine-grained harmful content detection,

  • it introduces a structured entity-augmented representation that makes harm-related entity cues explicit within the classifier's input,

  • it provides an empirical evaluation and error analysis on the ArGuard 2026 development set, identifying category-specific strengths and the principal sources of classification errors.

The remainder of this paper is organized as follows. Section 2 describes the shared-task objectives and dataset. Section 3 presents the overall system architecture, followed by the entity extraction and input representation methods. The MARBERT classification approach and experimental configuration are then described. Finally, the paper reports the evaluation results, discusses classification errors and ablation experiments, and concludes with directions for future work.