SchwaDeletionExtractor#

Defined in: voxatlas.features.phonology.reduction.schwa_deletion

class voxatlas.features.phonology.reduction.schwa_deletion.SchwaDeletionExtractor[source]#

Bases: BaseExtractor

Extract the phonology.reduction.schwa_deletion feature within the VoxAtlas pipeline.

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

Algorithm#

The extractor compares expected and observed segmental realizations to quantify reduction phenomena.

  1. Canonical-observed alignment Expected phoneme sequences are aligned with observed phoneme labels from the annotated speech signal.

  2. Reduction scoring The output is a binary or scalar mismatch measure, typically of the form \(x_i = \mathbf{1}[\mathrm{expected}_i \ne \mathrm{observed}_i]\) or a closely related normalized score.

  3. Packaging Values are returned on the requested phonological unit level for downstream aggregation.

Examples

>>> import pandas as pd
>>> from voxatlas.features.feature_input import FeatureInput
>>> from voxatlas.features.phonology.reduction.schwa_deletion import SchwaDeletionExtractor
>>> from voxatlas.units import Units
>>> words = pd.DataFrame({"id": [1], "label": ["hello"], "start": [0.0], "end": [1.0]})
>>> phonemes = pd.DataFrame([{"word_id": 1, "label": "h"}])
>>> units = Units(words=words, phonemes=phonemes)
>>> params = SchwaDeletionExtractor.default_config.copy()
>>> params["pronunciation_dictionary"] = {"hello": "h ə"}
>>> out = SchwaDeletionExtractor().compute(FeatureInput(audio=None, units=units, context={}), params)
>>> float(out.values.loc[1])
1.0
name: str = 'phonology.reduction.schwa_deletion'#
input_units: str | None = 'word'#
output_units: str | None = 'word'#
dependencies: list[str] = []#
default_config: dict = {'pronunciation_dictionary': None, 'schwa_symbols': ['ə', '@', 'schwa']}#
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 word unit level when applicable.

Return type:

FeatureOutput

Examples

>>> import pandas as pd
>>> from voxatlas.features.feature_input import FeatureInput
>>> from voxatlas.features.phonology.reduction.schwa_deletion import SchwaDeletionExtractor
>>> from voxatlas.units import Units
>>> words = pd.DataFrame({"id": [1], "label": ["hello"], "start": [0.0], "end": [1.0]})
>>> phonemes = pd.DataFrame([{"word_id": 1, "label": "h"}])
>>> units = Units(words=words, phonemes=phonemes)
>>> params = SchwaDeletionExtractor.default_config.copy()
>>> params["pronunciation_dictionary"] = {"hello": "h ə"}
>>> result = SchwaDeletionExtractor().compute(FeatureInput(audio=None, units=units, context={}), params)
>>> result.unit
'word'