# Biomedical Flat and Nested Named Entity Recognition: Methods, Challenges, and Advances
## 4 Deep Learning Methods for Nested NER
### Span Labeling Approaches
#### 4.2.3 MRC  
The MRC-based approaches typically receive information about the entity type to be predicted in the form of a query along with the sentence and then predict the boundary of the corresponding type (Figure 2b).  
BERT-MRC utilizes the queries in natural language format [90]. The model passes the concatenation of the sentence with the query through an encoding layer, allowing the information from the query to be integrated into the sentence representation. BERT-MRC employs three binary classifiers to handle nested NEs. The two classifiers are designed to identify candidates for head and tail tokens of NEs, respectively. Subsequently, the last classifier determines whether each head-tail pair is an appropriate target for the query. BERT-MRC generates each query for one specific entity type, encountering the limitation that it can handle only one entity type per inference. Therefore, it fails to consider interrelations among entities of different types. Moreover, the model involves a manual process for crafting appropriate queries for each entity type, adding to its complexity.  
To overcome these shortcomings, [PERSON] et al. designed the parallel instance query network (PIQN) [91]. PIQN employs instance queries that are learnable vectors, diverging from the traditional natural language form. These instance queries are initialized with random values and autonomously learn their semantic significance during the training phase. The sentence is encoded independently, whereas the instance queries interact with the sentence's embedding through cross-attention mechanisms. This allows the queries to extract relevant contextual information without altering the original sentence encoding. PIQN utilizes query embeddings to identify and classify NEs instead of using sentence embeddings. For each query, two separate linear layers are used to predict the start and end positions of the span corresponding to the query. After determining the span boundaries, a span classification layer is applied to categorize the span into a specific entity type. In other words, each query is designed to identify only a single entity, ensuring that one query corresponds to one entity prediction. The process for multiple queries occurs in parallel, allowing the model to efficiently handle multiple entities within the same sentence.  
This section introduces two models that utilize different query formats: traditional natural language queries and learnable vector formats. BERT-MRC, which employs traditional natural language queries, provides the model with precise, user-defined information. However, the manual crating of these queries requires domain-specific expertise, and the model's performance is highly dependent on the quality of the queries. In contrast, PIQN leverages learnable vector format queries that dynamically acquire information about entities during training. This model enhances flexibility and adaptability across various entity types without the need for manual input. Furthermore, the parallel instance query mechanism in PIQN allows for the simultaneous prediction of multi-type NEs, capturing correlations between types and significantly reducing inference time.