## 3 Results and Discussion
\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Class** & \multicolumn{3}{c}{**Partial**} & \multicolumn{3}{c}{**Exact**} \\  & **P** & **R** & **F1** & **P** & **R** & **F1** \\ \hline T023 & **0.75 \(\pm\) 0.113** & 0.631 \(\pm\) 0.195 & 0.664 \(\pm\) 0.119 & **0.716 \(\pm\) 0.107** & 0.604 \(\pm\) 0.192 & 0.635 \(\pm\) 0.12 \\ T047 & 0.651 \(\pm\) 0.065 & 0.748 \(\pm\) 0.124 & 0.692 \(\pm\) 0.071 & 0.58 \(\pm\) 0.067 & 0.668 \(\pm\) 0.128 & 0.617 \(\pm\) 0.079 \\ T058 & 0.638 \(\pm\) 0.064 & 0.588 \(\pm\) 0.147 & 0.602 \(\pm\) 0.068 & 0.604 \(\pm\) 0.064 & 0.556 \(\pm\) 0.135 & 0.569 \(\pm\) 0.061 \\ T079 & 0.602 \(\pm\) 0.045 & **0.786 \(\pm\) 0.067** & 0.681 \(\pm\) 0.049 & 0.553 \(\pm\) 0.051 & 0.721 \(\pm\) 0.072 & 0.625 \(\pm\) 0.056 \\ T080 & 0.589 \(\pm\) 0.088 & 0.583 \(\pm\) 0.067 & 0.585 \(\pm\) 0.073 & 0.548 \(\pm\) 0.085 & 0.542 \(\pm\) 0.063 & 0.544 \(\pm\) 0.07 \\ T081 & 0.616 \(\pm\) 0.086 & 0.721 \(\pm\) 0.148 & 0.655 \(\pm\) 0.084 & 0.572 \(\pm\) 0.096 & 0.672 \(\pm\) 0.165 & 0.61 \(\pm\) 0.109 \\ T184 & 0.706 \(\pm\) 0.024 & 0.755 \(\pm\) 0.079 & **0.729 \(\pm\) 0.045** & 0.667 \(\pm\) 0.023 & 0.714 \(\pm\) 0.079 & **0.688 \(\pm\) 0.046** \\ C1518422 & 0.702 \(\pm\) 0.059 & 0.747 \(\pm\) 0.303 & 0.685 \(\pm\) 0.194 & 0.702 \(\pm\) 0.059 & **0.747 \(\pm\) 0.303** & 0.685 \(\pm\) 0.194 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performances of bsc-bio-ehr-es models for a learning rate of \(5.0\times 10^{-5}\) mean \(\pm\) std for the NER task in our dataset constructed from maternal EHRs. Bold values identify the highest results per column. \begin{table}
\begin{tabular}{l c c c c c c} \hline \hline
**Class** & \multicolumn{3}{c}{**Partial**} & \multicolumn{3}{c}{**Exact**} \\  & **P** & **R** & **F1** & **P** & **R** & **F1** \\ \hline T023 & 0.616 \(\pm\) 0.117 & 0.745 \(\pm\) 0.143 & 0.663 \(\pm\) 0.088 & 0.589 \(\pm\) 0.122 & 0.713 \(\pm\) 0.152 & 0.635 \(\pm\) 0.101 \\ T047 & 0.636 \(\pm\) 0.047 & 0.769 \(\pm\) 0.036 & 0.695 \(\pm\) 0.034 & 0.583 \(\pm\) 0.06 & 0.704 \(\pm\) 0.036 & 0.637 \(\pm\) 0.048 \\ T058 & 0.605 \(\pm\) 0.074 & 0.69 \(\pm\) 0.088 & 0.64 \(\pm\) 0.056 & 0.576 \(\pm\) 0.08 & 0.654 \(\pm\) 0.069 &bsc-bio-es model achieves higher performance scores in both exact and partial schemes. However, it is worth noting that the bsc-bio-ehr-es model stands out particularly in class T023 (Anatomy), which could be attributed to its pre-training on electronic health records. Based on these results, we select the bsc-bio-es model. Figure 3 displays the confusion matrix for the bsc-bio-es model. The matrix reveals that classes with larger samples generally detect more true positives than false positives. Notably, classes with the prefix \"B\" perform better than those with the prefix \"I\". For instance, class I-T023, with only five samples in the test set, does not have any true positives. On the other hand, class T184 detects 466 true positives while producing 201 false positives. It is important to mention that the majority of false positives belong to the non-entity class (\"O\" in the BIO tagging scheme). This work introduces the first fine-tuning of an NER model designed explicitly for maternal electronic health records (EHRs). We conducted fine-tuning on five models using our dataset, and the best-performing model achieved an F1 micro score of 0.83 and an F1 macro score of 0.55%. These results are comparable to other state-of-the-art NER models fine-tuned in Spanish and the biomedical domain [30]. For example, the bio-ehr-es model achieved an F1 micro score of 0.834 on the CANTEMIST dataset [30]. It is worth noting that the best model reported in the CANTEMIST challenge achieved an F1 micro score of 0.89. The CANTEMIST corpus includes 1301 annotated clinical documents, with 63,016 sentences and 16,030 mentions of entities related to tumor morphologies.