An Embarrassingly Easy but Strong Baseline for Nested Named Entity Recognition (2023)

Abstract: Named entity recognition (NER) is the task to detect and classify entity spans in the text. When entity spans overlap between each other, the task is named as nested NER. Span-based methods have been widely used to tackle nested NER. Most of these methods get a score matrix, where each entry corresponds to a span. However, previous work ignores spatial relations in the score matrix. In this paper, we propose using Convolutional Neural Network (CNN) to model these spatial relations. Despite being simple, experiments in three commonly used nested NER datasets show that our model surpasses several recently proposed methods with the same pre-trained encoders. Further analysis shows that using CNN can help the model find more nested entities. Besides, we find that different papers use different sentence tokenizations for the three nested NER datasets, which will influence the comparison. Thus, we release a pre-processing script to facilitate future comparison.

## introduction named entity recognition (ner) is the task to extract entities from raw text. it has been a fundamental task in the natural language processing (nlp) field. previously, this task is mainly solved by the sequence labeling paradigm through assigning a label to each token @xcite @xcite . however, this method is not directly applicable to the nested ner scenario, since a token may be included in two or more entities. to overcome this issue, the spanbased method which assigns labels to each span is introduced (eberts and ulges, 2020; @xcite . is 1 new 2 york 3 university 4 in 5 united 6 states 7 is 1 new 2 york 3 university 4 in 5 united 6 states 7 a o center span backend tokens clash with the center span b front tokens clash with the center span c containing the center span d contained by the center span e no clash figure 1 : all valid spans of a sentence. we use the start and end tokens to pinpoint a span, for instance, "(2-4)" represents "new york university". spans in the two orange dotted squares indicates that the center span can have the special relationship (different relations are depicted in different colors) with its surrounding spans. for example, the span "new york" (2-3) is contained by the span "new york university" (2-4). therefore, the "(2-3)" span is annotated as "d". eberts and ulges (2020) use a pooling method over token representations to get the span representation, and then conduct classification on this span representation. @xcite transform the ner task into a machine reading comprehension (mrc) form, they use the entity type as the query, and ask the model to select spans that belong to this entity type. @xcite utilize the biaffine decoder from dependency parsing @xcite to convert the span classification into classifying the start and end token pairs. however, these work does not take advantage of the spatial correlations between adjacent spans. as depicted in figure 1 , spans surrounding a span have special relationships with the center span. it should be beneficial if we can leverage these spatial correlations. in this paper, we use the biaffine decoder @xcite to get a 3d feature matrix, where each entry represents one span. after that, we view the span feature matrix as a spatial object with channels (like images) and utilize convolutional neural network (cnn) to model the local interaction between spans. we compare this simple method with recently proposed methods @xcite @xcite . to make sure our method is strictly comparable to theirs, we ask the authors for their version of data. although all of them use the same datasets, we find that the statistics, such as the number of sentences and entities, are not the same. the difference is caused by the usage of distinct sentence tokenization methods, which will influence the performance as shown in our experiments. to facilitate future comparison, we release a pre-processing script for ace2004, ace2005 and genia datasets. our contributions can be summarized as follows. ## proposed method in this section, we first introduce the nested ner task, then describe how to get the feature matrix. after that, we present the cnn module to model the spatial correlation on the feature matrix. a general framework can be viewed in figure 2 . ## experiment 3.1 experimental setup to verify the effectiveness of our proposed method, we conduct experiments in three widely used nested ner datasets, ace 2004 foot_1 @xcite , ace 2005 5 (walker and consortium, 2005) and genia @xcite . besides, we choose recently published papers as our baselines. to make sure our experiments are strictly comparable to theirs, we ask the authors for their versions of data. the data statistics for each paper are listed in the appendix b. for ace2004 and ace2005, although all of them use the same document split as suggested @xcite , they use different sentence tokenizations, resulting in different numbers of sentences and entities. to facilitate future research on nested ner, we release the pre-processing code and fix some tokenization issues to avoid including unannotated text and dropping entities. while for the genia data, there are some annotation conflicts. for examples, one document with the bibliomisc med-line:97218353 is duplicated in the original data, and different work has different annotations on it. we fix these conflicts. we replicate each experiment five times and report its average performance with standard derivation. ## related work previously, four kinds of paradigms have been proposed to solve the nested ner task. the first one is the sequence labeling framework @xcite , since one token can be contained in more than one entities, the cartesian product of the entity labels are used. however, the cartesian labels will suffer from the long-tail issue. the second one is to use the hypergraph to efficiently represent spans @xcite @xcite . the shortcoming of this method is the complex decoding. the third one is the sequence-to-sequence (seq2seq) framework @xcite @xcite to generate the entity sequence. the entity sequence can be the entity pointer sequence @xcite or the entity text sequence @xcite . nevertheless, the seq2seq method suffers from the time-demanding decoding. the fourth one is to conduct span classification. eberts and ulges (2020) proposed to enumerate all possible spans within a sentence, and use a pooling method to get the span representation. while @xcite proposed to use the start and end tokens of a span to pinpoint the span, and use the biaffine decoder to get the scores for each span. the span-based methods are friendly to parallelism and the decoding is easy. therefore, this formulation has been widely adopted @xcite @xcite . however, the relation between neighbor spans was ignored in previous work. ## conclusion in this paper, we propose using cnn on the score matrix of span-based ner model. although this method is very simple, it achieves comparable or better performance than recently proposed methods. analysis shows exploiting the spatial correlation between neighbor spans through cnn can help model find more nested entities. and experiments show that different tokenizations indeed influence the performance. therefore, it is necessary to make sure all comparative baselines use the same tokenization. to facilitate future comparison, we release a new pre-processing script for three nested ner datasets.