stratify
- stratify(mappings: Iterable[SemanticMapping], *, accept_unspecified: bool = True) Stratification[source]
Stratify mappings into a positive, negative, and predicted (positive) set.
- Parameters:
mappings – A collection of semantic mappings
accept_unspecified – Whether to consider mappings that do not have an explicit justification (i.e., using
semapv:UnspecifiedMatching) as having been manually curated
- Returns:
A stratification tuple
Semantic mappings are stratified as predicted versus curated based on their mapping justification. Predicted semantic mappings have one of the following:
semapv:LexicalMatchingsemapv:LexicalSimilarityThresholdMatchingsemapv:LogicalReasoningsemapv:SemanticSimilarityThresholdMatchingsemapv::StructuralMatching
Manually curated semantic mappings have one of the following justifications:
semapv:ManualMappingCurationsemapv:UnspecifiedMatching(when opted in with theaccept_unspecifiedflag)
Remaining mapping justifications in the Semantic Mapping Vocabulary (SEMAPV) can’t be easily categorized. Semantic mappings are then subcategorized as positive or negative (i.e., when the predicate modifier is set to
Not). Note, there are typically no negative predicted semantic mappings because software focuses on producing positive semantic mappings.If needed, negative mappings can be sampled using techniques based on the open world assumption (OWA) or local closed world assumption (LCWA). The PyKEEN graph machine learning library has detailed documentation on these processes. However, SSSOM-Pydantic focuses on evaluations that don’t consider predicted negative mappings.