LIPN at W ojood NER shared task: A Span-Based Approach for Flat and Nested A rabic Named Entity Recognition (2023)

Abstract: The Wojood Named Entity Recognition (NER) shared task introduces a comprehensive Arabic NER dataset encompassing both flat and nested entity tasks, addressing the challenge of limited Arabic resources. In this paper, we present our team LIPN approach to addressing the two subtasks of WojoodNER SharedTask. We frame NER as a span classification problem. We employ a pretrained language model for token representations and neural network classifiers. We use global decoding for flat NER and a greedy strategy for nested NER. Our model secured the first position in flat NER and the fourth position in nested NER during the competition, with an F-score of 91.96 and 92.45 respectively. Our code is publicly available ( https://github.com/niamaelkhbir/LIPN-at-WojoodSharedTask ).

## introduction named entity recognition (ner) plays a crucial role in various natural language processing (nlp) applications, enabling the extraction and classification of entities from unstructured text. these entities span a wide range of categories, including individuals, organizations, locations, and dates, among others. while ner has witnessed significant progress, challenges persist, particularly in contexts marked by resource scarcity and linguistic complexity, such as the arabic language. in this context, the focus of arabic nlp has predominantly revolved around flat entities @xcite @xcite @xcite , and the exploration of nested entity recognition in arabic nlp has been relatively limited, primarily due to the scarcity of suitable nested arabic datasets. to address these limitations, the wojoodner sharedtask 2023 @xcite initiative was launched with the goal of overcoming these challenges. this initiative introduces the wojood corpus @xcite , an extensively annotated arabic ner dataset comprising approximately 550,000 tokens. it includes annotations for 21 distinct entity types, covering both modern standard arabic (msa) and dialectal variations, as well as flat and nested entity annotations. the shared task objective is twofold: firstly, to encourage innovative solutions in flat ner, and secondly, to tackle nested ner. for both tasks, the aim is to develop models that can effectively identify and classify entities while accounting for complexities. this paper outlines our strategy for tackling these subtasks. our approach relies on a spanbased methodology, employing token encoding, span enumeration, and subsequent classification. during inference, we employ global decoding for flat ner and a greedy decoding strategy for nested ner. our contributions led us to achieve the top position in flat ner and the fourth position in nested ner during the wojoodner sharedtask 2023. in the following sections, we provide detailed insights into our methodology, experimentation, and the results achieved, highlighting the efficacy of our approach within the wojoodner sharedtask 2023. approaches for ner traditionally, ner tasks have been framed as sequence labeling @xcite , i.e., tokenlevel classification. recently, innovative approaches have extended beyond token-level prediction. some methods have treated ner as a question-answering problem @xcite , while others have employed sequence-to-sequence models @xcite . in this work, we focus on span-based methods @xcite @xcite , which involve enumerating all possible spans and then classifying them into specific entity types. the wojood corpus is annotated for 21 different entity types, and it offers two versions: wojood flat and wojood nested. both versions share identical training, validation, and test splits, differing only in the way entities are labeled. in wojood flat, each token receives a label corresponding to the first high-level label assigned to that token in wojood nested. furthermore, to offer insights into the entity distribution based on span lengths, figure 1 displays the entity count distribution concerning span lengths within the flat wojood training data. note that for the sake of clarity in visualization, we have excluded entity counts for span lengths of 27, 29, 39, 43, and 124, each of which occurs either once or twice. we have established a maximum entity span length of 10 for our span-based model. any entities surpassing this threshold are automatically excluded. specifically, the training set includes 140 such entities, predominantly categorized as website, date, and event. similarly, in the validation set, 19 entities exceed the 10-span limit. an input sequence @xmath0, our goal is to classify all possible spans within the sequence, which can be defined as: decoding during inference, our aim is to determine: in other words, we seek to identify the span labeling configuration (@xmath1. for unconstrained span classification, a straightforward approach is to assign the label with the highest score to each individual span, as follows: however, for both flat and nested ner, such a decoding strategy is suboptimal as it can lead to violations of structural constraints. for flat ner, where overlapping entity spans are not allowed, an efficient solution has been proposed in our previous works @xcite foot_1 . this approach involves a two-stage decoding process: first, spans predicted as non-entities are filtered out, and then a maximum independent set algorithm is applied to the remaining spans to obtain the optimal set of entity spans. in contrast, for nested ner, where nesting is permitted but conflicting boundaries are prohibited, we employ a greedy algorithm to achieve a valid span classification. this algorithm iteratively selects the highest-scoring span that does not conflict with already selected spans. token and span representations in our approach, the span score ϕ θ (s ijc |x) is computed as a linear projection of the span representation, obtained through a 1d convolution of token representations from a bert-based model: ## results evaluation metrics following the shared task guidelines, we assess the performance of our model using precision, recall, and f1-score. settings and hyperparameters for token representation, we use bert-base-arabert (antoun et al., 2020) as a pretrained language model. subsequently, we process the encoded tokens through a bidirectional long short-term memory (bi-lstm) encoder to obtain the final representations. we set a maximum span length of 10 for enumerating all possible spans, which is a good balance between recall and training speed (refer to limitations section). our model is trained with a batch size of 12 and evaluated with a batch size of 32. we set a learning rate of 5e-6 for bert and 1e-3 for other model parameters. we use the adam optimizer and train our model for 50,000 steps, conducting evaluations every 250 steps. we ran our experiments on a server equipped with v100 gpus, and we estimated the needed computational budget for training to be 50 gpu hours. ## conclusion our approach to arabic named entity recognition in the wojoodner shared task 2023 yielded competitive results, securing first place in flat ner and fourth in nested ner. this success highlights the potential of span-based methods and advanced decoding strategies. moreover, we identified areas for improvement, including addressing class imbalance and refining span boundary predictions. occ cardinal product gpe percent date ordinal website pers unit curr fac language time law event norp loc org money quantity predicted label occ cardinal product gpe percent date ordinal website pers unit curr fac language time law event norp loc org money quantity true label 499 0 0