InflectionMoodExtractor#
Defined in: voxatlas.features.morphology.inflection.mood
- class voxatlas.features.morphology.inflection.mood.InflectionMoodExtractor[source]#
Bases:
BaseExtractorExtract the
morphology.inflection.moodfeature within the VoxAtlas pipeline.This public extractor defines the reusable API for computing
morphology.inflection.moodfrom VoxAtlas structured inputs. It consumestokenunits and produces values aligned totokenunits, making the extractor a stable pipeline node that can be cited independently of the surrounding execution machinery.Algorithm#
The extractor projects morphological annotations or derived segmentation features onto the token index.
Morphological preparation Token-level annotations or derived morphological resources are loaded from the dependency graph.
Feature computation Depending on the extractor, the output is a categorical label, a binary indicator \(\mathbf{1}[\cdot]\), or a count such as \(N_i^{morpheme}\).
Packaging The result is returned as a token-aligned scalar series so later discourse-level aggregation can preserve speaker and timing metadata.
Notes
This extractor declares the upstream dependencies [‘morphology.inflection.features’] 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.morphology.inflection.mood import InflectionMoodExtractor >>> from voxatlas.pipeline.feature_store import FeatureStore >>> table = pd.DataFrame({"id": [1], "Mood": ["Ind"]}) >>> store = FeatureStore() >>> store.add("morphology.inflection.features", TableFeatureOutput(feature="morphology.inflection.features", unit="token", values=table)) >>> out = InflectionMoodExtractor().compute(FeatureInput(audio=None, units=None, context={"feature_store": store}), {}) >>> out.values.loc[1] 'Ind'
- name: str = 'morphology.inflection.mood'#
- input_units: str | None = 'token'#
- output_units: str | None = 'token'#
- dependencies: list[str] = ['morphology.inflection.features']#
- 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
tokenunit 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.morphology.inflection.mood import InflectionMoodExtractor >>> from voxatlas.pipeline.feature_store import FeatureStore >>> table = pd.DataFrame({"id": [1], "Mood": ["Ind"]}) >>> store = FeatureStore() >>> store.add("morphology.inflection.features", TableFeatureOutput(feature="morphology.inflection.features", unit="token", values=table)) >>> result = InflectionMoodExtractor().compute(FeatureInput(audio=None, units=None, context={"feature_store": store}), {}) >>> result.unit 'token'