# Named Entity Recognition Networks Based on Syntactically Constrained Attention
## 4 Materials and Methods
### Analysis and Discussion  
#### 4.4.1 Analysis of the Validity of Syntactic Information  
In syntactic attention networks, we use sentence dependencies as constraint information. Four sets of comparison experiments were conducted on the ACE2005 dataset, in \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{3}{c}{**ACE2004**} \\ \hline
**Model** & **P** & **R** & **F1** \\ \hline [PERSON] et al. [35] & - & - & 84.4 \\ [PERSON] et al. [17] & - & - & 84.7 \\ [PERSON] et al. [18]\({}^{\star}\) & 85.42 & 85.92 & 85.67 \\ [PERSON] et al. [1]\({}^{\star}\) & 86.38 & 85.07 & 85.72 \\ \hline SCAN-Net (ours) & **86.91** & **85.11** & **86.0** \\ \hline \multicolumn{3}{c}{**ACE2005**} \\ \hline
**Model** & **P** & **R** & **F1** \\ \hline [PERSON] et al. [35] & - & - & 84.33 \\ [PERSON] et al. [1]\({}^{\star}\) & 85.48 & 84.36 & 84.92 \\ [PERSON] et al. [18]\({}^{\star}\) & 84.5 & 84.72 & 84.61 \\ [PERSON] et al. [19] & 83.95 & 85.39 & 84.66 \\ [PERSON] et al. [20] & 83.16 & **86.38** & 84.74 \\ [PERSON] et al. [22] & - & - & 84.30 \\ [PERSON] et al. [23] & 84.61 & 86.43 & 85.53 \\ \hline SCAN-Net (ours) & **85.98** & 85.45 & **85.71** \\ \hline \multicolumn{3}{c}{**GENIA**} \\ \hline
**Model** & **P** & **R** & **F1** \\ \hline [PERSON] et al. [35] & - & - & 76.44 \\ [PERSON] et al. [1]\({}^{\star}\) & 79.62 & 76.8 & 78.19 \\ [PERSON] et al. [18]\({}^{\star}\) & 79.43 & 78.32 & 78.87 \\ [PERSON] et al. [19] & 79.45 & 78.94 & 79.19 \\ [PERSON] et al. [20] & 78.87 & **79.6** & 79.23 \\ [PERSON] et al. [22] & - & - & 78.30 \\ [PERSON] et al. [23] & 78.08 & 78.26 & 78.16 \\ \hline SCAN-Net (ours) & **79.95** & 79.52 & **79.73** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of the performance of the ACE2004, ACE2005 and GENIA datasets. \({}^{\star}\) indicates the results we achieved through their code. Bold numbers indicate the best results. order to demonstrate the positive impact of constraint information on the model: (1) by simply adding a multiheaded self-attentive mechanism; (2) by using a soft-pruning strategy (3) by using a hard-pruning strategy. The results of the experiments are shown in Table 5.  
From Table 5, we can see that the soft-pruning strategy model improves the F1 score by 0.42% over the baseline, and the hard-pruning strategy model improves the F1 score by 0.79% over the baseline. This is because the use of the hard-pruning strategy was able to help the model reduce the weight of redundant information in the sentences by using the dependencies as constraint information, thus retaining more important syntactic information, and proving that the syntactic information is effective for the NER task. In addition, the hard-pruning strategy model was more effective overall than the soft-pruning strategy model, which we speculate is because the soft-pruning strategy model only adds additional attentional weight to strong words, and does not constrain the attention scattered over weak words. Although the attention weight of the strong words is increased, the weak words will still influence the model's judgment. In contrast, the hard-pruning strategy model directly eliminates the attention from weak words, thus solving the attention distraction problem. The table also shows that the hard-pruning strategy model has a higher \(p\) value than the soft-pruning strategy model, but a slightly lower R-value. We speculate that this is because the syntactic dependency tree is generated by the natural language-processing toolkit only, and not by manual annotation, so when processing some sentences, there may be incorrect syntactic dependency trees generated, resulting in the hard-pruning strategy model ignoring some words that have some relevance to the task, and thus failing to recognize some named entities. This is the reason for the slightly lower R-value of the hard-pruning model as compared to the soft-pruning model.