dataeval.core.label_reconciliation

dataeval.core.label_reconciliation(class_names, ontology)

Reconcile class labels against an ontology and recover their hierarchy.

Reconciliation matches each class name to the ontology’s concepts (by preferred label, synonyms, or exact id) and reports whether the label set conforms (every name matched unambiguously), alongside the recovered hierarchy of the matched classes.

Parameters:
class_names : Iterable[str]

Dataset class names to reconcile, e.g. index2label.values().

ontology : Ontology

Ontology to reconcile against.

Returns:

Match report (matched / unmatched / ambiguous), ancestor paths, the induced sub-hierarchy, and pairwise relations among matched classes.

Return type:

LabelReconciliationResult

Notes

Ambiguous names (resolving to more than one concept) are excluded from the hierarchy outputs; resolve them upstream (e.g. by passing concept ids).