vertebrae.execution.zero_shot
Artifact-backed primitives for frozen zero-shot evaluation.
Functions
|
Build a stable endpoint key while allowing sample artifacts to be prompt-reused. |
|
Build the canonical serialized prompt-protocol artifact key. |
Build a paired compression prefix for zero-shot endpoints. |
|
|
Build a stable zero-shot scoring artifact key for resolved evaluation settings. |
|
Persist labels and fixed prompt declarations independently of model outputs. |
|
Materialize one deterministic zero-shot endpoint shard. |
|
Merge one endpoint after validating its side, branch, and provenance. |
|
Fit compression on sample embeddings and transform prompt embeddings. |
|
Score persisted frozen endpoints and contextual sample overlap. |
|
Submit independent zero-shot scoring jobs through local, Ray, or Dask execution. |
|
Plan deterministic endpoint jobs for one zero-shot side. |
|
Reconstruct a rankable zero-shot report from persisted score artifacts. |
Module Contents
- vertebrae.execution.zero_shot.zero_shot_embedding_artifact_key(dataset, extractor, side, branch)[source]
Build a stable endpoint key while allowing sample artifacts to be prompt-reused.
- Parameters:
dataset (Any)
extractor (Any)
side (str)
branch (str)
- Return type:
str
- vertebrae.execution.zero_shot.zero_shot_protocol_artifact_key(dataset)[source]
Build the canonical serialized prompt-protocol artifact key.
- Parameters:
dataset (Any)
- Return type:
str
- vertebrae.execution.zero_shot.zero_shot_compression_artifact_key(sample_embedding_key, prompt_embedding_key, config)[source]
Build a paired compression prefix for zero-shot endpoints.
- Parameters:
sample_embedding_key (str)
prompt_embedding_key (str)
config (Any)
- Return type:
str
- vertebrae.execution.zero_shot.zero_shot_scoring_artifact_key(sample_embedding_key, prompt_embedding_key, protocol_key, zero_shot_config=None, scoring_config=None)[source]
Build a stable zero-shot scoring artifact key for resolved evaluation settings.
- Parameters:
sample_embedding_key (str)
prompt_embedding_key (str)
protocol_key (str)
zero_shot_config (Optional[vertebrae.config.ZeroShotConfig])
scoring_config (Optional[vertebrae.config.OverlapScoringConfig])
- Return type:
str
- vertebrae.execution.zero_shot.materialize_zero_shot_protocol(dataset, store, key=None)[source]
Persist labels and fixed prompt declarations independently of model outputs.
- Parameters:
dataset (Any)
store (vertebrae.cache.ArtifactStore)
key (Optional[str])
- Return type:
dict
- vertebrae.execution.zero_shot.materialize_zero_shot_embedding_shard(job, store)[source]
Materialize one deterministic zero-shot endpoint shard.
- Parameters:
store (vertebrae.cache.ArtifactStore)
- Return type:
dict
- vertebrae.execution.zero_shot.merge_zero_shot_embedding_shards(job, store)[source]
Merge one endpoint after validating its side, branch, and provenance.
- Parameters:
store (vertebrae.cache.ArtifactStore)
- Return type:
dict
- vertebrae.execution.zero_shot.compress_zero_shot_embedding_artifacts(job, store)[source]
Fit compression on sample embeddings and transform prompt embeddings.
- Parameters:
store (vertebrae.cache.ArtifactStore)
- Return type:
dict
- vertebrae.execution.zero_shot.score_zero_shot_artifact(job, store)[source]
Score persisted frozen endpoints and contextual sample overlap.
- Parameters:
store (vertebrae.cache.ArtifactStore)
- Return type:
dict
- vertebrae.execution.zero_shot.score_zero_shot_artifacts(jobs, store, execution)[source]
Submit independent zero-shot scoring jobs through local, Ray, or Dask execution.
- Parameters:
jobs (Iterable[vertebrae.execution.jobs.ZeroShotScoringJob])
store (vertebrae.cache.ArtifactStore)
execution (Any)
- Return type:
list[dict]
- vertebrae.execution.zero_shot.plan_zero_shot_embedding_shard_jobs(dataset, extractor, total_shards, *, side, branch, batch_size=128, resource_profiling_config=None, output_key=None, run_prefix=None)[source]
Plan deterministic endpoint jobs for one zero-shot side.
- Parameters:
dataset (Any)
extractor (Any)
total_shards (int)
side (str)
branch (str)
batch_size (int)
resource_profiling_config (Optional[vertebrae.config.ResourceProfilingConfig])
output_key (Optional[str])
run_prefix (Optional[str])
- Return type:
- vertebrae.execution.zero_shot.zero_shot_benchmark_result_from_artifacts(score_keys, store, output_key=None)[source]
Reconstruct a rankable zero-shot report from persisted score artifacts.
Alignment and overlap results remain separate fields; the ranking always follows the configured zero-shot primary metric recorded in each score artifact.
- Parameters:
score_keys (Iterable[str])
store (vertebrae.cache.ArtifactStore)
output_key (Optional[str])
- Return type:
Any