pyeeg.features.SyntacticFeatureExtractor.extract_to_dict

SyntacticFeatureExtractor.extract_to_dict(text: str, features: List[str] = None) Dict[str, Dict[int, float]]

Extract features and return as word position -> value dict.

Convenience wrapper around extract() that converts each per-word value list into a mapping from word position (0-based index in the tokenized text) to the feature value as a float. Suitable for input to pyeeg.features.alignment.AlignmentHandler.align_word_features().

Parameters:
  • text (str) – Input text to process.

  • features (list of str, optional) – Feature names to extract; see extract() for valid values. If None, defaults to ["all"].

Returns:

result – Mapping from feature name to a dict of word position -> feature value, with one entry per word.

Return type:

dict of str -> dict of int -> float