vertebrae.utils.semantic_labels
Portable identities for semantic labels and typed report metadata.
Classes
Marker for a value already converted to a canonical semantic label key. |
Functions
|
Return a collision-resistant JSON object key for one semantic label. |
|
Build an ordered, JSON-safe catalog without importing user label classes. |
|
Serialize a sequence of labels into stable scoring keys. |
|
Return a one-dimensional object array of marked semantic keys. |
|
Resolve either an original label or serialized key to reportable text. |
|
Convert typed values to deterministic JSON without lossy |
|
Validate an artifact label catalog and return normalized entries. |
|
Serialize a value under the strict JSON rules used by protocol tests. |
Module Contents
- class vertebrae.utils.semantic_labels.SemanticLabelKey[source]
Bases:
strMarker for a value already converted to a canonical semantic label key.
- vertebrae.utils.semantic_labels.semantic_label_key(value)[source]
Return a collision-resistant JSON object key for one semantic label.
- Parameters:
value (Any)
- Return type:
str
- vertebrae.utils.semantic_labels.semantic_label_catalog(values)[source]
Build an ordered, JSON-safe catalog without importing user label classes.
- Parameters:
values (Iterable[Any])
- Return type:
List[Dict[str, Any]]
- vertebrae.utils.semantic_labels.semantic_label_keys(values)[source]
Serialize a sequence of labels into stable scoring keys.
- Parameters:
values (Iterable[Any])
- Return type:
List[str]
- vertebrae.utils.semantic_labels.canonical_semantic_array(values)[source]
Return a one-dimensional object array of marked semantic keys.
- Parameters:
values (Iterable[Any])
- Return type:
numpy.ndarray
- vertebrae.utils.semantic_labels.label_display(value, catalog)[source]
Resolve either an original label or serialized key to reportable text.
- Parameters:
value (Any)
catalog (Sequence[Mapping[str, Any]])
- Return type:
str
- vertebrae.utils.semantic_labels.portable_json(value)[source]
Convert typed values to deterministic JSON without lossy
strfallbacks.- Parameters:
value (Any)
- Return type:
Any