vertebrae.structured

Structured unit materialization parallel to spatial segmentation flows.

Classes

StructuredMaterialization

One flattened, grouped structured embedding output.

StructuredAlignment

One explicit one-to-one mapping from embeddings to annotation rows.

StructuredUnitAligner

Named callable that aligns structured embeddings to annotated units.

Functions

drop_special_rows([leading, trailing, name])

Return an aligner that drops fixed leading/trailing embedding rows.

keep_row_indices(embedding_indices[, ...])

Return an aligner that keeps an explicit subset of embedding rows.

select_frame_rows(*[, every_n, indices, ...])

Return an aligner that maps annotations to selected frame rows.

materialize_structured_outputs(dataset, extractor[, ...])

Extract, align, and flatten declared structured outputs.

iter_materialize_structured_outputs(dataset, extractor)

Yield structured outputs one at a time after shared extraction and alignment.

Module Contents

class vertebrae.structured.StructuredMaterialization[source]

One flattened, grouped structured embedding output.

class vertebrae.structured.StructuredAlignment[source]

One explicit one-to-one mapping from embeddings to annotation rows.

class vertebrae.structured.StructuredUnitAligner(name, align_fn, recipe_data=None, cache_identity=None)[source]

Named callable that aligns structured embeddings to annotated units.

Parameters:
  • name (str)

  • align_fn (Callable[[Any, Dict[str, Any]], Any])

  • recipe_data (Optional[Dict[str, Any]])

  • cache_identity (Optional[str])

vertebrae.structured.drop_special_rows(leading=0, trailing=0, *, name='drop_special_rows')[source]

Return an aligner that drops fixed leading/trailing embedding rows.

Parameters:
  • leading (int)

  • trailing (int)

  • name (str)

Return type:

StructuredUnitAligner

vertebrae.structured.keep_row_indices(embedding_indices, annotation_indices=None, *, name='keep_row_indices')[source]

Return an aligner that keeps an explicit subset of embedding rows.

Parameters:
  • embedding_indices (Sequence[int])

  • annotation_indices (Optional[Sequence[int]])

  • name (str)

Return type:

StructuredUnitAligner

vertebrae.structured.select_frame_rows(*, every_n=None, indices=None, indices_metadata_key=None, start=0, name='select_frame_rows')[source]

Return an aligner that maps annotations to selected frame rows.

Parameters:
  • every_n (Optional[int])

  • indices (Optional[Sequence[int]])

  • indices_metadata_key (Optional[str])

  • start (int)

  • name (str)

Return type:

StructuredUnitAligner

vertebrae.structured.materialize_structured_outputs(dataset, extractor, batch_size=16, aligners=None, resource_profiler=None, memory_config=None)[source]

Extract, align, and flatten declared structured outputs.

Parameters:
Return type:

List[StructuredMaterialization]

vertebrae.structured.iter_materialize_structured_outputs(dataset, extractor, batch_size=16, aligners=None, resource_profiler=None, memory_config=None)[source]

Yield structured outputs one at a time after shared extraction and alignment.

Parameters:
Return type:

Iterator[StructuredMaterialization]