VowelReductionExtractor#
Defined in: voxatlas.features.phonology.reduction.vowel_reduction
- class voxatlas.features.phonology.reduction.vowel_reduction.VowelReductionExtractor[source]#
Bases:
BaseExtractorExtract the
phonology.reduction.vowel_reductionfeature within the VoxAtlas pipeline.This public extractor defines the reusable API for computing
phonology.reduction.vowel_reductionfrom VoxAtlas structured inputs. It consumeswordunits and produces values aligned towordunits, 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.
Canonical-observed alignment Expected phoneme sequences are aligned with observed phoneme labels from the annotated speech signal.
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.
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.vowel_reduction import VowelReductionExtractor >>> 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": "ə"}]) >>> units = Units(words=words, phonemes=phonemes) >>> params = VowelReductionExtractor.default_config.copy() >>> params["pronunciation_dictionary"] = {"hello": "i"} >>> out = VowelReductionExtractor().compute(FeatureInput(audio=None, units=units, context={}), params) >>> float(out.values.loc[1]) 1.0
- name: str = 'phonology.reduction.vowel_reduction'#
- input_units: str | None = 'word'#
- output_units: str | None = 'word'#
- dependencies: list[str] = []#
- default_config: dict = {'central_vowels': ['ə', 'ɘ', 'ɜ', 'ɐ'], '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
FeatureInputbundle, 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
wordunit level when applicable.- Return type:
FeatureOutput
Examples
>>> import pandas as pd >>> from voxatlas.features.feature_input import FeatureInput >>> from voxatlas.features.phonology.reduction.vowel_reduction import VowelReductionExtractor >>> 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": "ə"}]) >>> units = Units(words=words, phonemes=phonemes) >>> params = VowelReductionExtractor.default_config.copy() >>> params["pronunciation_dictionary"] = {"hello": "i"} >>> result = VowelReductionExtractor().compute(FeatureInput(audio=None, units=units, context={}), params) >>> result.unit 'word'