# Ontology Attention Layer for Medical Named Entity Recognition
## 5 Experimental Results and Discussion
### Discussion on the Granularity of the Ontology  
After the last round of experiments, we found that the proposed attention mechanism worked better than the self-attention mechanism. Considering that our ontological attention mechanism reduces sparsity by subdividing text, the more words it contains, the greater the sparsity. In this round of experiments, the original structure of the ontology attention mechanism was not changed. Instead, the input body was replaced with ontology of different granularity. Because the input body was different, the mask calculated during the calculation was also different. As a result, the calculated ontological similarities are also inconsistent, resulting in different F1 scores. The main points of this study are based on medical ontology. We defined three classes of grain properties: coarse, medium, and fine. Details regarding the design of this experiment are provided in Table 4, and the results of the comparison are shown in Figure 5.  
According to the experimental results, the NER performance of the proposed model with a medium-grained ontology is approximately 0.2% higher than that with a coarse-grained ontology. When the granularity increases further, there is a decrease in the results. A possible reason of the latter result is that the distance of words in semantic space becomes far when the granularity of the ontology increases too much, resulting in increased sparsity, although appropriately increasing the granularity can enhance the semantic richness, resulting in better representation of domain knowledge. \begin{table}
\begin{tabular}{c c} \hline \hline
**Group** & **Contained Property Types** \\ \hline Coarse-grained & class name only without properties \\ Medium-grained & entity-type properties \\ Fine-grained & entity-type properties, attribute-type properties \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Setup of groups for the experiment on the influence of the granularity type properties. \begin{table}
\begin{tabular}{c l l l l} \hline \hline
**ID** & **Text** & **Plain Base Model** & **w/ Proposed Method** & **w/ Self-Attention** \\ \hline \multirow{3}{*}{11} & As constitutional DNA was not available, a putative & \multirow{3}{*}{(None)} & \multirow{3}{*}{T-} & \multirow{3}{*}{T-} \\  & hereditary predisposition to **T-PLL** will require further & & & \\ \cline{1-1}  & investigation. & & & \\ \hline \multirow{3}{*}{18} & Neither the content nor the activity of Na\({}^{+}/\)K\({}^{+}\) ATPase & \multirow{3}{*}{(None)} & \multirow{3}{*}{(None)} & \multirow{3}{*}{(None)} & \multirow{3}{*}{(None)} \\  & and sarcoplasmic reticulum Ca\({}^{2+}\)-ATPase are affected & by DMPK absence. & & \\ \cline{1-1} \cline{3-5}  & Saamis (2\%) and Mordvinians (1.8\%) had significantly & & & \\ \cline{1-1}  & lower frequencies of the Tyr allele. & & & \\ \hline \multirow{3}{*}{94} & Numerous cytogenetic and allelotype studies have reported frequent loss of heterozygosity on chromosomal & \multirow{3}{*}{prostate cancer} & \multirow{3}{*}{**sporadic prostate cancer**} & \multirow{3}{*}{prostate cancer} \\  & arm 10q in **sporadic prostate cancer**. & & & \\ \hline \multirow{3}{*}{138} & We conclude that paternal transmission of **congenital** & \multirow{3}{*}{DM} & \multirow{3}{*}{DM, DM} & \multirow{3}{*}{**congenital DM, DM**} & \multirow{3}{*}{DM, DM} \\  & & & & \\ \cline{1-1}  & & & & \\ \cline{1-1}  & Mutations in the SMAD4/DPC4 **tumor** suppressor gene, & \multirow{3}{*}{ pancreatic cancers} & \multirow{3}{*}{**tumor, pancreatic cancers**} & \multirow{3}{*}{**tamor, pancreatic cancers**} \\ \cline{1-1}  & a key signal transducer in most TGFbeta-related pathways, are involved in 50 \% of **pancreatic cancers**. & & \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Output examples for the NCBI disease dataset when BERT-base was used as the base model. “ID” refers to the data ID in the NCBI disease dataset. In the “Text” column, we display the input texts. The bold words in the “Text” column represent the ground truth.