# Hybridizing Fuzzy String Matching and Machine Learning for Improved Ontology Alignment
## 4 Proposed Method
\begin{table}
\begin{tabular}{c c} \hline \hline
**Variable Name** & **Description** \\ \hline \(O_{s}\) & Source ontology \\ \(O_{t}\) & Target ontology \\ _reference_ & An _xml_ document containing the similarity scores between each pair of classes in \(O_{s}\) and \(O_{l}\) \\ _osLabels_ & A document containing the labels of all classes in the source ontology \\ _otLabels_ & A document containing the labels of all classes in the target ontology \\ _finalScores_ & A _csv_ document containing the similarity scores for both fuzzy \\ \multicolumn{2}{c}{string-matching algorithms and BERT} \\ \multicolumn{2}{c}{_refAMLFile_} & A _csv_ documents containing three columns representing the URIs of \\ \multicolumn{2}{c}{each pair of classes from \(O_{s}\) and \(O_{t}\) and their similarity scores} \\ \multicolumn{2}{c}{generated by the baseline AML alignment system} \\ _smKNNScores_ & A _csv_ document containing the final similarity scores of the alignment \\ \multicolumn{2}{c}{by the SM-kNN model} \\ _smSVRScores_ & A _csv_ document containing the final similarity scores of the alignment \\ \multicolumn{2}{c}{by the SM-SVR model} \\ \multicolumn{2}{c}{_smDTRScores_} & A _csv_ document containing the final similarity scores of the alignment \\ \multicolumn{2}{c}{by the SM-DTR model} \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Variables used in Algorithm 1. Figure 2: Proposed model that hybridizes fuzzy string matching and machine learning for automatic ontology alignment. periment, we set the AML threshold to 0.60 and used the _mouse_ and _human_ ontologies as the source ontology (\(O_{s}\)) and target ontology (\(O_{t}\)), respectively. These ontologies were downloaded from the anatomy track in the OAEI 2022. To evaluate the performance of our proposed method against the widely-used AML alignment system, we first fed AML with the source ontology and target ontology to obtain the reference similarity scores in line 3 of Algorithm 1. The GetURIsScores() function then takes the _reference_ as a parameter to extract the URIs of each pair of matched classes, as well as their similarity scores, and store this information in the _refAMLFile_ file in line 4. In lines 6-17 of Algorithm 1, the classes' URIs are read from the _refAMLFile_ file and passed to a SPARQL query to extract their labels; the extracted classes' labels are then stored in _osLabels_ and _otLabels_ files for the source and target ontologies, respectively. The fuzzy string-matching algorithms are then applied for lexical alignment, followed by BERT for semantic alignment, in lines 19-25. The similarity scores obtained by each algorithm are stored in the _finalScores_ file in line 26. Next, in lines 28-30 of Algorithm 1, the reference similarity scores obtained by the AML system are appended to the _finalScores_ file to prepare the data for the training of the models. The dot product in line 29 of Algorithm 1 indicates that the resulting values will be stored in the _finalScore_ CSV file. This is followed by the training of the SM-kNN, SM-SVR, and SM-DTR models in lines 32-34 of the algorithm. Finally, the trained _SMKnmModel_, _SMSvrModel_, and _SMDtrModel_ models are used to predict the similarity scores for each pair of classes in the input ontologies \(O_{s}\) and \(O_{t}\) in lines 36-38. The predicted similarity scores for each model are then stored in a CSV file with three columns for the source class, the target class, and the predicted similarity score (lines 36-38). The next section presents and discusses the experimental results of the study. ```
1.Inputs: O\({}_{s}\), O\({}_{t}\), reference
2.Outputs: smKNNScores, smSVRScores, smDTRScores, finalScores
3.reference \(\leftarrow\) AML_alignment(O\({}_{s}\), O\({}_{t}\))
4.refAMLFile\(\leftarrow\) GetURIsScores(reference)
5. 6.For each row in refAMLfile Do
7.uriSource \(\leftarrow\) ReadUri(row(1))
8.uriTarget \(\leftarrow\) ReadUri(row(2))
9.osLabels \(\leftarrow\) SPARQL(
10.\"SELECT DISTINCT? label
11.WHERE [ <\"+uriSource+\"> rdfs:label? label]\"
12.)