vertebrae.scoring.zero_shot

Exact, frozen prompt-prototype scoring for zero-shot alignment.

Classes

ZeroShotScoreResult

Metrics and diagnostics for one fixed zero-shot prompt protocol.

ZeroShotScorer

Score frozen samples against fixed text prompt prototypes.

Module Contents

class vertebrae.scoring.zero_shot.ZeroShotScoreResult[source]

Metrics and diagnostics for one fixed zero-shot prompt protocol.

class vertebrae.scoring.zero_shot.ZeroShotScorer(config=None)[source]

Score frozen samples against fixed text prompt prototypes.

Prompt rows belonging to one class are normalized, averaged with equal weight, then normalized once more. No fitted calibration or prompt selection occurs.

Parameters:

config (Optional[vertebrae.config.ZeroShotConfig])

score(sample_embeddings, prompt_embeddings, labels, *, class_labels, prompt_labels, template_ids=None, sample_ids=None, labels_are_semantic_keys=False)[source]

Evaluate exact sample-to-class prototype matching.

Parameters:
  • sample_embeddings (Any)

  • prompt_embeddings (Any)

  • labels (Any)

  • class_labels (Sequence[Any])

  • prompt_labels (Sequence[Any])

  • template_ids (Optional[Sequence[str]])

  • sample_ids (Optional[Sequence[Any]])

  • labels_are_semantic_keys (bool)

Return type:

ZeroShotScoreResult