RhythmDeltaCExtractor#

Defined in: voxatlas.features.phonology.rhythm.delta_c

class voxatlas.features.phonology.rhythm.delta_c.RhythmDeltaCExtractor[source]#

Bases: BaseExtractor

Extract the phonology.rhythm.delta_c feature within the VoxAtlas pipeline.

This public extractor defines the reusable API for computing phonology.rhythm.delta_c from VoxAtlas structured inputs. It consumes phoneme units and produces values aligned to ipu units, making the extractor a stable pipeline node that can be cited independently of the surrounding execution machinery.

Algorithm#

The extractor derives rhythm statistics from aligned syllables or phoneme-derived interval tables at the IPU level.

  1. Unit preparation Phoneme, syllable, and IPU tables are aligned so that each interval or syllable can be assigned to a speaking chunk.

  2. Metric computation Consonant-duration variability is \(\Delta C = \mathrm{sd}(d^{(c)})\).

  3. Packaging The result is aligned to ipu units so it can participate in later aggregation stages or conversation-level summaries.

Notes

This extractor declares the upstream dependencies [‘phonology.rhythm.intervals’] and is executed only after those features are available in the pipeline feature store.

Examples

>>> import pandas as pd
>>> from voxatlas.features.feature_input import FeatureInput
>>> from voxatlas.features.feature_output import TableFeatureOutput
>>> from voxatlas.features.phonology.rhythm.delta_c import RhythmDeltaCExtractor
>>> from voxatlas.pipeline.feature_store import FeatureStore
>>> intervals = pd.DataFrame(
...     [{"ipu_id": 1, "type": "c", "duration": 1.0}, {"ipu_id": 1, "type": "c", "duration": 3.0}]
... )
>>> store = FeatureStore()
>>> store.add(
...     "phonology.rhythm.intervals",
...     TableFeatureOutput(feature="phonology.rhythm.intervals", unit="ipu", values=intervals),
... )
>>> out = RhythmDeltaCExtractor().compute(FeatureInput(audio=None, units=None, context={"feature_store": store}), {})
>>> round(float(out.values.loc[1]), 1)
1.0
name: str = 'phonology.rhythm.delta_c'#
input_units: str | None = 'phoneme'#
output_units: str | None = 'ipu'#
dependencies: list[str] = ['phonology.rhythm.intervals']#
default_config: dict = {}#
compute(feature_input, params)[source]#

Compute the extractor output for a single pipeline invocation.

This method is the reusable execution entry point for the extractor. It receives the standard FeatureInput bundle, applies the configured algorithm, and returns feature values aligned to the extractor output units for storage in the pipeline feature store.

Parameters:
  • feature_input (object) – Structured extractor input bundling audio, hierarchical units, and execution context for this feature computation.

  • params (object) – Resolved feature configuration for this invocation. Keys are feature-specific and merged from defaults and pipeline settings.

Returns:

Structured output aligned to the ipu unit level when applicable.

Return type:

FeatureOutput

Examples

>>> import pandas as pd
>>> from voxatlas.features.feature_input import FeatureInput
>>> from voxatlas.features.feature_output import TableFeatureOutput
>>> from voxatlas.features.phonology.rhythm.delta_c import RhythmDeltaCExtractor
>>> from voxatlas.pipeline.feature_store import FeatureStore
>>> intervals = pd.DataFrame([{"ipu_id": 1, "type": "c", "duration": 1.0}])
>>> store = FeatureStore()
>>> store.add(
...     "phonology.rhythm.intervals",
...     TableFeatureOutput(feature="phonology.rhythm.intervals", unit="ipu", values=intervals),
... )
>>> feature_input = FeatureInput(audio=None, units=None, context={"feature_store": store})
>>> result = RhythmDeltaCExtractor().compute(feature_input, {})
>>> result.unit
'ipu'