vertebrae.datasets.zero_shot
Dataset contracts for frozen zero-shot semantic-alignment evaluation.
Classes
One declared target class and its fixed text prompts. |
|
A single-label dataset paired with an explicit fixed prompt protocol. |
Module Contents
- class vertebrae.datasets.zero_shot.ZeroShotClassSpec[source]
One declared target class and its fixed text prompts.
- class vertebrae.datasets.zero_shot.ZeroShotDataset[source]
A single-label dataset paired with an explicit fixed prompt protocol.
The underlying
BenchmarkDatasetsupplies raw samples and labels. Prompt text is deliberately part of this dataset rather than hidden in an extractor so that it participates in cache keys, reports, and reproducible recipes.- classmethod from_dataset(dataset, class_prompts, *, metadata=None)[source]
Create a protocol from fully rendered prompts keyed by class label.
- Parameters:
dataset (vertebrae.datasets.base.BenchmarkDataset)
class_prompts (Mapping[Any, Any])
metadata (Optional[Dict[str, Any]])
- Return type:
- classmethod from_templates(dataset, templates, *, class_names=None, metadata=None)[source]
Expand explicit
{label}templates for each observed class.- Parameters:
dataset (vertebrae.datasets.base.BenchmarkDataset)
templates (Iterable[str])
class_names (Optional[Mapping[Any, str]])
metadata (Optional[Dict[str, Any]])
- Return type:
- property samples: Any[source]
Return source samples in their original deterministic order.
- Return type:
Any
- property labels: numpy.ndarray[source]
Return canonical single-label targets.
- Return type:
numpy.ndarray
- prompt_rows()[source]
Return flattened prompts, their class labels, and optional template IDs.
- Return type:
Tuple[Tuple[str, Ellipsis], Tuple[Any, Ellipsis], Optional[Tuple[str, Ellipsis]]]
- protocol_recipe()[source]
Return complete, stable prompt provenance for artifacts and JSON reports.
- Return type:
Dict[str, Any]