# Named Entity Recognition Networks Based on Syntactically Constrained Attention
## 1 Introduction  
Named Entity Recognition (NER) is a fundamental task in Natural Language Processing (NLP) that aims to detect entity spans and semantic categories in a given context. Current NER can be classified into two subclasses: flat NER and nested NER, depending on whether the entities are nested or not. Nested entities are those with nested spans, such as \"[Bank of [China] ]\", where both \"[China]\" and \"[Bank of China]\" are named entities. This type of entity is common in datasets such as ACE2004, ACE2005, and GENIA. Recently, [PERSON] et al. [1] proposed a unified approach to solve the nested entity problem. They transformed the named entity recognition task into a Machine Reading Comprehension (MRC) task, where they used the annotation information of the predefined tag set as a query (as shown in Table 1). They then used a pre-trained language model to learn the joint representation of the query and context, and finally predicted the label of each token. This method has achieved good results in named entity recognition tasks. Figure 1 illustrates the process of the model, based on machine reading comprehension in identifying named entities. When compared to other methods used for processing natural language tasks, the approach based on machine reading comprehension has its own advantages. Other methods lack priority semantic information about the entity type, and the resulting models do not have a semantic understanding of the entity type being extracted. In contrast, the machinereading comprehension approach benefits from a query, such as \"find an organization in the context. \", that encourages the model to link the word \"organizational\" in the query to the location entities in the context. Moreover, the model can reduce the ambiguity of similar label categories by encoding a comprehensive description of label categories. However, [PERSON] et al. [1] overlooked the problem that, if the context sequence is lengthy and does not emphasize words strongly associated with the task (referred to as strong words), the model may focus on all words, resulting in the allocation of more attention to weakly associated words (referred to as weak words). Under the influence of these words, the model's focus on text components becomes biased. The key to improving machine reading comprehension performance lies in the ability to effectively model language knowledge from verbose details, as well as to overcome noise. [PERSON] et al. [2] suggested using syntax to guide the text modeling of context and questions, in order to obtain better word representations of language motivation, and achieved good results in machine reading comprehension tasks. Inspired by [PERSON] et al. [2], we propose a \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Entity Type** & **Query** \\ \hline \multirow{4}{*}{ACE2005} & \multirow{4}{*}{GPE} & geographical political entities are geographical regions defined by political and or social groups, such as countries, nations, regions, cities, states, and the government and its people. \\  & & location entities are limited to geographical entities, such as geographical areas and landmasses, mountains, bodies of water, and geological formations. \\  & & \
\begin{tabular}{c} PER \\ a person entity is limited to humans, including a single individual or a group. \\ \end{tabular} \\ \hline \multirow{2}{*}{GENIA} & \multirow{2}{*}{GENIA} & cell\_line & find all cell line entities in the context. \\  & &
\begin{tabular}{c} DNA \\ protein \\ \end{tabular} & find all DNA entities in the context. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Example of converting different entity categories into question queries. If the annotation information of the entity type exists, it is summarized as a query, as shown in the queries corresponding to the GPE, LOC and PER types in the ACE2005 dataset.