## 2 Materials and Methods
### MGFGF-BiLSTM-EGP
#### 3.3.3 Effect of Sentence Encoder

The sentence encoder's impact on model performance is more nuanced and depends on its combination with other modules. When combined with the word encoder (Model 3), the F1 score reached 82.67%, a modest increase of 0.35% compared to Model 2, which used only the word encoder. This slight improvement may be due to the introduction of the sentence encoder, which could add redundant information in the absence of a pre-trained model. When the sentence encoder was combined with the pre-trained model (Model 5), the F1 score increased slightly to 88.34%, just 0.33% higher than Model 1 (88.01%), which only used the pre-trained model. In Model 6, the F1 score achieved its maximum of 91.98% when all three modules were used together, an improvement of 0.65% compared to Model 4. These results suggest that the sentence encoder, when used alongside the pre-trained model and word encoder, can marginally enhance the global semantic representation of the model. ## 4 Discussion

### Confusion Matrix Analysis

Figure 8 illustrates the performance of the nested named entity recognition model across three datasets (CDNER, CMeEE V2, and CLUENER) that used a confusion matrix to evaluate classification accuracy. The confusion matrix revealed a recurring issue of missing classifications, particularly in the \"Other\" category, where the model failed to assign certain entities to any specific category. This problem was most prominent in the medical-related CDNER and CMeEE V2 datasets, where entities like \"symptoms\" \"body parts\" and \"diseases\" were frequently missing classifications. For instance, in the CDNER dataset, 245 \"symptom\" entities were missing classifications, indicating the model's limited accuracy in recognizing these medical terms. Similarly, in the CMeEE V2 dataset, 1958 \"bod\" and 964 \"sym\" entities were missing classifications. The CLUENER dataset also showed instances of missing classification, particularly in categories like \"position\" and \"address\", further demonstrating the model's difficulty in correctly identifying these entities. In addition to missing classifications, the issue of misclassification was also noteworthy. The model sometimes incorrectly assigned entities to the wrong category such as classifying \"company\" as \"position\" or \"name\". This misclassification may have stemmed from semantic overlaps between categories and the model's limited ability to process complex contexts. ### Visualization of Token Representations in Feature Space

We conducted feature visualization and analysis across three datasets: CDNER, CMeEE V2, and CLUENER. By labeling 50 entities per category and extracting their features, we applied t-SNE for dimensionality reduction to facilitate visualization. Our analysis focused on two approaches: word vectors and MFGFF. Figure 9 illustrates that the effectiveness of MFGFF varied significantly across different datasets. In the CDNER dataset, the original word vector representations exhibited minimal distinction between feature vectors across entity categories, leading to substantial overlap and dispersion. This lack of clear differentiation was evident. However, following MFGFF, the feature representations improved markedly, with data points clustering more centrally within their respective categories. This resulted in more distinct category clusters and enhanced inter-category distinguishability. Despite these improvements, challenges remained such as the observed similarity between categories like 'body part' and'symptom' This overlap likely arose from semantic similarities or nested relationships within the text. Figure 8: Visualization of the confusion matrix, where the ‘Other’ category represents missing classification. Figure 9: Visualization of token representations in feature space using t-SNE for data dimensionality reduction, with different colored points representing labeled entities of different types including word vector features and MFGFF features visualized on three datasets.