vertebrae.datasets.zero_shot

Dataset contracts for frozen zero-shot semantic-alignment evaluation.

Classes

ZeroShotClassSpec

One declared target class and its fixed text prompts.

ZeroShotDataset

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 BenchmarkDataset supplies 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:
Return type:

ZeroShotDataset

classmethod from_templates(dataset, templates, *, class_names=None, metadata=None)[source]

Expand explicit {label} templates for each observed class.

Parameters:
Return type:

ZeroShotDataset

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

validated()[source]

Validate the source target and explicit prompt protocol.

Return type:

ZeroShotDataset

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]

class_labels()[source]

Return the validated class-label snapshot in protocol order.

Return type:

Tuple[Any, Ellipsis]

sample_ids()[source]

Return the validated source-sample ID snapshot.

Return type:

Tuple[Any, Ellipsis]