InterPausalUnit

class entrainment_metrics.interpausal_unit.InterPausalUnit(start: float, end: float, features_values: Optional[Dict[str, float]] = None)

It’s an interval of time between silences of a speaker in a conversation.

start

Start time of the IPU.

Type

float

end

End time of the IPU.

Type

float

features_values

A dictionary with the features calculated and their values.

Type

Optional[Dict[str, float]]

calculate_features(audio_file: Path, pitch_gender: Optional[str] = None, extractor: Optional[str] = None) Optional[Dict[str, float]]

Feature extraction for an InterPausalUnit.

Parameters
  • audio_file (Path) – A path to a wav file.

  • pitch_gender (Optional[str]) – Useful for a more accurate praat extraction. “M” or “F”, or None.

  • extractor (Optional[str]) – The extractor to calculate features. It can be either “praat” ,”opensmile”, or “allosaurus”/”speech-rate”. Default is “opensmile”.

Returns

A dictionary with the value for each feature calculated.

Return type

Dict[str, float]

feature_value(feature: str) float

Return the value for the feature given if already extracted

Visualization

entrainment_metrics.utils.plot_ipus(ipus: List[InterPausalUnit], feature: str, **kwargs)

Plot the IPU’s feature values with its corresponding lenght.

Parameters
  • ipus (List[InterPausalUnit]) – The list of IPUs from which to extract information.

  • feature (str) – The feature from which to extract the feature value of each InterPausalUnit.

entrainment_metrics.utils.print_ipus_information(ipus: List[InterPausalUnit], feature: str)

Print lenght, std, mean, min, max, min start, and max end from the list of IPUs.

Parameters
  • ipus (List[InterPausalUnit]) – The list of IPUs from which to extract information.

  • feature (str) – The feature from which to extract the feature value of each InterPausalUnit.