SyntaxLocalStructureDependencyLabelExtractor#
Defined in: voxatlas.features.syntax.local_structure.dep_label
- class voxatlas.features.syntax.local_structure.dep_label.SyntaxLocalStructureDependencyLabelExtractor[source]#
Bases:
BaseExtractorExtract the
syntax.local_structure.dep_labelfeature within the VoxAtlas pipeline.This public extractor defines the reusable API for computing
syntax.local_structure.dep_labelfrom 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 works directly from the dependency-annotated token table produced earlier in the pipeline.
Parsed token retrieval Token rows, head identifiers, and dependency metadata are loaded from the upstream syntax table.
Local-structure computation The feature exposes the dependency label assigned to each token from the parsed dependency table.
Packaging Values are returned at token resolution so they can be aggregated into sentence-level complexity measures later in the pipeline.
Notes
This extractor declares the upstream dependencies [‘syntax.dependencies’] 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.syntax.local_structure.dep_label import SyntaxLocalStructureDependencyLabelExtractor >>> from voxatlas.pipeline.feature_store import FeatureStore >>> deps = pd.DataFrame({"token_id": [1, 2], "dep_label": ["nsubj", "root"]}) >>> store = FeatureStore() >>> store.add("syntax.dependencies", TableFeatureOutput(feature="syntax.dependencies", unit="token", values=deps)) >>> out = SyntaxLocalStructureDependencyLabelExtractor().compute(FeatureInput(audio=None, units=None, context={"feature_store": store}), {}) >>> out.values.loc[1] 'nsubj'
- name: str = 'syntax.local_structure.dep_label'#
- input_units: str | None = 'token'#
- output_units: str | None = 'token'#
- dependencies: list[str] = ['syntax.dependencies']#
- 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.syntax.local_structure.dep_label import SyntaxLocalStructureDependencyLabelExtractor >>> from voxatlas.pipeline.feature_store import FeatureStore >>> deps = pd.DataFrame({"token_id": [1], "dep_label": ["root"]}) >>> store = FeatureStore() >>> store.add("syntax.dependencies", TableFeatureOutput(feature="syntax.dependencies", unit="token", values=deps)) >>> result = SyntaxLocalStructureDependencyLabelExtractor().compute(FeatureInput(audio=None, units=None, context={"feature_store": store}), {}) >>> result.unit 'token'