# Hybridizing Fuzzy String Matching and Machine Learning for Improved Ontology Alignment
## 4 Proposed Method
BERT also achieved the highest accuracy of 82.21%, compared to the fuzzy string-matching algorithms, followed by the Jaro-Winkler algorithm with 62.78% accuracy which outperformed the rest of fuzzy string-matching algorithms. To further challenge the algorithms, we raised the threshold to 0.90. Figure 5 displays the confusion matrices for the fuzzy string-matching algorithms and BERT at this threshold 0.90. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Variable Name** & **LCS** & **[PERSON]** & **[PERSON]** & **[PERSON]** & **BERT** \\ \hline Precision & 0.975425331 & 1 & 1 & 0.988250653 & 0.917348609 \\ Recall & 0.406619385 & 0.365642238 & 0.337142857 & 0.596532703 & 0.88337 \\ F1-score & 0.573971079 & 0.535487594 & 0.504273504 & 0.743980344 & 0.90004014 \\ Accuracy & 45.2857143\% & 42.5\% & 33.7142857\% & 62.7857143\% & 82.2142857\% \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance of fuzzy string-matching algorithms and BERT at threshold 0.80. Figure 4: Confusion matrix for fuzzy string-matching algorithms and BERT at threshold 0.80. (**a**) [PERSON], (**b**)[PERSON], (**c**) [PERSON], (**d**) [PERSON], (**e**) BERT. \begin{table}
\begin{tabular}{|c|c|c|c|c|} \hline \hline \multirow{2}{*}{**Predicted**} & \multicolumn{2}{c|}{**Actual**} & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & 464 & 0 & 516 & 13 \\ \cline{2-5}  & 805 & 131 & & 753 & 118 \\ \hline \multirow{4}{*}{**(a)**} & \multicolumn{4}{c|}{(b)} \\ \cline{2-5}  & \multicolumn{2}{c|}{**Actual**} & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & 472 & 0 & & 757 & 9 \\ \cline{2-5}  & 928 & 0 & & 512 & 122 \\ \hline \multicolumn{5}{c}{**(c)**} \\ \cline{2-5}  & \multicolumn{2}{c|}{**Actual**} \\ \hline \multirow{2}{*}{**Predicted**} & \multicolumn{1}{c|}{**Predicted**} & \multicolumn{1}{c|}{**Predicted**} \\ \cline{2-5}  & 928 & 0 & & 512 & 122 \\ \hline \multicolumn{5}{c}{**(c)**} \\ \cline{2-5}  & \multicolumn{2}{c|}{**Actual**} \\ \hline \multirow{2}{*}{**Predicted**} & \multicolumn{1}{c|}{**Predicted**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \hline \multirow{2}{*}{**Predicted**} & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \hline \multirow{2}{*}{**Predicted**} & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \cline{2-5}  & \multicolumn{1}{c|}{**Actual**} \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance of fuzzy string-matching algorithms and BERT at threshold 0.70. It can be observed in Figure 5 that the fuzzy string-matching algorithms detected very few true positives, while false negatives were more prevalent. Among the fuzzy string-matching algorithms, Jaro-Winkler performed the best in terms of true positives, detecting 87 cases, whereas Levenshtein performed the worst, detecting only 38 true positives. False positive cases were also relatively low and could be treated as true positives since the reference alignment provided by OAEI 2022 indicates that the similarity scores for all aligned pairs of classes should be 1.0. In contrast, BERT outperformed all the fuzzy string-matching algorithms, detecting over 50% of the total alignments (i.e., 728 true positive cases). Table 5 summarizes the performance of the fuzzy string-matching algorithms and BERT in terms of precision, recall, F1-score, and accuracy at threshold 0.90. It is shown in Table 5 that the Jaccard algorithm achieved the highest precision, while the other fuzzy string-matching algorithms obtained lower precision scores compared to the previous thresholds of 0.70 and 0.80. However, in terms of recall, all fuzzy string-matching algorithms recorded lowest values, while BERT outperformed them, not only in terms of recall, but also in terms of precision, F1-score, and accuracy.