-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsimple_example_equivalence_table.py
More file actions
38 lines (34 loc) · 1.24 KB
/
simple_example_equivalence_table.py
File metadata and controls
38 lines (34 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from semantic_matcher.model import SemanticMatch, EquivalenceTable
def return_simple_example_equivalence_table() -> EquivalenceTable:
"""
Returns a simple equivalence table with three semantic matches
"""
table = EquivalenceTable(matches={})
table.add_semantic_match(
SemanticMatch(
base_semantic_id="s-heppner.com/semanticID/one",
match_semantic_id="s-heppner.com/semanticID/1",
score=1.,
meta_information={"matchSource": "Defined by Sebastian Heppner"}
)
)
table.add_semantic_match(
SemanticMatch(
base_semantic_id="s-heppner.com/semanticID/two",
match_semantic_id="s-heppner.com/semanticID/2",
score=1.,
meta_information={"matchSource": "Defined by Sebastian Heppner"}
)
)
table.add_semantic_match(
SemanticMatch(
base_semantic_id="s-heppner.com/semanticID/one",
match_semantic_id="s-heppner.com/semanticID/two",
score=0.8,
meta_information={"matchSource": "Defined by Sebastian Heppner"}
)
)
return table
if __name__ == '__main__':
e = return_simple_example_equivalence_table()
e.to_file("example_equivalence_table.json")