ProsodicPositionInWordExtractor#
Defined in: voxatlas.features.phonology.prosody.position_word
- class voxatlas.features.phonology.prosody.position_word.ProsodicPositionInWordExtractor[source]#
Bases:
BaseExtractorExtract the
phonology.prosody.position_in_wordfeature within the VoxAtlas pipeline.This public extractor defines the reusable API for computing
phonology.prosody.position_in_wordfrom VoxAtlas structured inputs. It consumessyllableunits and produces values aligned tosyllableunits, making the extractor a stable pipeline node that can be cited independently of the surrounding execution machinery.Algorithm#
The extractor derives prosodic position or stress information from the aligned unit hierarchy.
Hierarchical alignment Word, syllable, and IPU tables are linked so each target unit has access to its local structural context.
Prosodic computation Depending on the feature, VoxAtlas computes a positional index, a normalized relative position, or a stress indicator \(\mathbf{1}[\mathrm{stressed}]\).
Packaging The result is returned on the requested unit level for later modeling of prominence and discourse structure.
Examples
>>> import pandas as pd >>> from voxatlas.features.feature_input import FeatureInput >>> from voxatlas.features.phonology.prosody.position_word import ProsodicPositionInWordExtractor >>> from voxatlas.units import Units >>> syllables = pd.DataFrame({"id": [10, 11], "start": [0.0, 0.5], "end": [0.5, 1.0]}) >>> words = pd.DataFrame({"id": [1], "start": [0.0], "end": [1.0]}) >>> units = Units(syllables=syllables, words=words) >>> out = ProsodicPositionInWordExtractor().compute(FeatureInput(audio=None, units=units, context={}), {}) >>> int(out.values.loc[10]), int(out.values.loc[11]) (1, 2)
- name: str = 'phonology.prosody.position_in_word'#
- input_units: str | None = 'syllable'#
- output_units: str | None = 'syllable'#
- dependencies: list[str] = []#
- 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
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
syllableunit level when applicable.- Return type:
FeatureOutput
Examples
>>> import pandas as pd >>> from voxatlas.features.feature_input import FeatureInput >>> from voxatlas.features.phonology.prosody.position_word import ProsodicPositionInWordExtractor >>> from voxatlas.units import Units >>> syllables = pd.DataFrame({"id": [10], "start": [0.0], "end": [0.5]}) >>> words = pd.DataFrame({"id": [1], "start": [0.0], "end": [1.0]}) >>> units = Units(syllables=syllables, words=words) >>> result = ProsodicPositionInWordExtractor().compute(FeatureInput(audio=None, units=units, context={}), {}) >>> result.unit 'syllable'