OAEI Utilities
This page concerns utility functions used in the OAEI.
get_ignored_class_index(onto)
Get an index for filtering classes that are marked as not used in alignment.
This is indicated by the special class annotation use_in_alignment
with the following IRI:
http://oaei.ontologymatching.org/bio-ml/ann/use_in_alignment
Source code in src/deeponto/align/oaei.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
remove_ignored_mappings(mappings, ignored_class_index)
Filter prediction mappings that involve classes to be ignored.
Source code in src/deeponto/align/oaei.py
46 47 48 49 50 51 52 53 |
|
matching_eval(pred_maps_file, ref_maps_file, null_ref_maps_file=None, ignored_class_index=None, pred_maps_threshold=None)
Conduct global matching evaluation for the prediction mappings against the reference mappings.
The prediction mappings are formatted the same as full.tsv
(the full reference mappings),
with three columns: "SrcEntity"
, "TgtEntity"
, and "Score"
, indicating the source
class IRI, the target class IRI, and the corresponding mapping score.
An ignored_class_index
needs to be constructed for omitting prediction mappings
that involve a class marked as not used in alignment.
Use the following code to obtain such index for both the source and target ontologies:
ignored_class_index = get_ignored_class_index(src_onto)
ignored_class_index.update(get_ignored_class_index(tgt_onto))
Source code in src/deeponto/align/oaei.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
read_candidate_mappings(cand_maps_file, for_biollm=False, threshold=0.0)
Load scored or already ranked candidate mappings.
The predicted candidate mappings are formatted the same as test.cands.tsv
, with three columns:
"SrcEntity"
, "TgtEntity"
, and "TgtCandidates"
, indicating the source reference class IRI, the
target reference class IRI, and a list of tuples in the form of (target_candidate_class_IRI, score)
where
score
is optional if the candidate mappings have been ranked. For the Bio-LLM special sub-track, "TgtCandidates"
refers to a list of triples in the form of (target_candidate_class_IRI, score, answer)
where the answer
is
required for computing matching scores.
This method loads the candidate mappings in this format and parse them into the inputs of mean_reciprocal_rank
and [hits_at_K
][[mean_reciprocal_rank
][deeponto.align.evaluation.AlignmentEvaluator.hits_at_K].
For Bio-LLM, the true prediction mappings and reference mappings will also be generated for the matching evaluation, i.e., the inputs of f1
.
Source code in src/deeponto/align/oaei.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
ranking_result_file_check(cand_maps_file, ref_cand_maps_file)
Check if the ranking result file is formatted correctly as the original
test.cands.tsv
file provided in the dataset.
Source code in src/deeponto/align/oaei.py
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
|
ranking_eval(cand_maps_file, Ks=[1, 5, 10])
Conduct local ranking evaluation for the scored or ranked candidate mappings.
See read_candidate_mappings
for the file format and loading.
Source code in src/deeponto/align/oaei.py
175 176 177 178 179 180 181 182 183 184 |
|
is_rejection(preds, cands)
A successful rejection means none of the candidate mappings are predicted as true mappings.
Source code in src/deeponto/align/oaei.py
192 193 194 |
|
biollm_eval(cand_maps_file, Ks=[1], threshold=0.0)
Conduct Bio-LLM evaluation for the Bio-LLM formatted candidate mappings.
See read_candidate_mappings
for the file format and loading.
Source code in src/deeponto/align/oaei.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
Created: July 23, 2023