## 2 Materials and Methods
### MGFGF-BiLSTM-EGP
The outputs from each attention head are concatenated and undergo a linear transformation:

\[\text{MultiHead}(Q,K,V)=\text{Concat}(\text{head}_{1},\text{head}_{2},\dots, \text{head}_{h})W_{O} \tag{11}\]

where \(\text{MultiHead}(Q,K,V)\) denotes the final weighted output of the word vector through the multi-head attention mechanism, and the concatenated outputs are transformed using the projection matrix \(W_{O}\) to produce the final output. #### 2.3.3 Sentence Encoder

SBERT (Sentence-BERT) enhances BERT by utilizing Siamese and triplet network architectures to generate fixed-size sentence embeddings. It employs a BERT model with shared weights to process pairs of sentences, creating sentence vectors through pooling operations. As shown in Figure 5, initially each input sentence is processed by BERT, producing token representations denoted as \(\{h_{1},h_{2},\dots,h_{n}\}\), where \(h_{i}\) is the vector representation of the \(i\)-th token. SBERT then applies a mean pooling operation to these token vectors to derive a fixed-length sentence vector:

\[f_{j}^{\prime}=\log\bigl{(}1+f_{j}\bigr{)} \tag{4}\]0

Here, \(h_{i}\) is the vector of the \(i\)-th token, and \(n\) is the total number of tokens in the sentence. \[f_{j}^{\prime}=\log\bigl{(}1+f_{j}\bigr{)} \tag{4}\]1 Sentence encoder framework. SBERT uses a Siamese network structure to process sentence pairs, as shown in Figure 5, where each sentence is passed through a BERT model with shared weights to produce its corresponding sentence vector. Given a pair of sentences \(s_{1}\) and \(s_{2}\), their respective sentence vectors \(u_{1}\) and \(u_{2}\) are generated as follows:

\[f_{j}^{\prime}=\log\bigl{(}1+f_{j}\bigr{)} \tag{4}\]2

\[f_{j}^{\prime}=\log\bigl{(}1+f_{j}\bigr{)} \tag{4}\]3

This structure allows SBERT to efficiently compare and measure the similarity between sentence pairs by producing consistent and comparable sentence embeddings. #### 2.3.4 BiLSTM

LSTM networks are a type of recurrent neural network (RNN) designed to overcome issues like gradient vanishing in traditional RNNs when dealing with long sequences and are effective for time series data and capturing long-term dependencies. However, standard LSTMs only process information in one direction, which limits their ability to fully capture context in text sequences. Bidirectional LSTM (BiLSTM) solves this by processing the sequence in both forward and backward directions. It uses two LSTM networks, one for the original sequence and one for the reversed sequence. The combined output captures information from both past and future contexts, making BiLSTM particularly useful for tasks like NER, where understanding context from both directions is important. In this article, BiLSTM was used to optimize the output of the embedding layer. #### 2.3.5 Efficient Global Pointer

The global pointer (GP) method enhances NER by employing a span classification approach that treats the head and tail of an entity as a unified pair. This approach provides a more holistic view of the entity, ensuring that training, prediction, and evaluation processes are consistently conducted at the entity level. This global perspective allows the GP to effectively recognize both nested and non-nested entities. The efficient global pointer (EGP) builds upon the GP approach by addressing the issue of parameter explosion, a common challenge in complex models. EGP decomposes the NER task into two subtasks: extraction and classification. This approach enables parameter sharing during extraction, which significantly reduces the number of parameters needed for classification. Consequently, the EGP is more scalable and efficient compared to its predecessor. Furthermore, the EGP introduces a specialized loss function, inspired by circle loss, to manage class imbalance. This loss function ensures that the scores of the target classes consistently exceed those of the non-target classes, enhancing the model's ability to distinguish between different entities.