nnmnkwii.frontend.merlin.duration_features

nnmnkwii.frontend.merlin.duration_features(hts_labels, *args, **kwargs)[source]

Duration features from HTS-style full-context labels.

The input full-context must be aligned with phone-level or state-level.

Parameters:
  • hts_labels (hts.HTSLabelFile) – HTS label file.
  • feature_type (str) – numerical or binary
  • unit_size (str) – phoneme or state
  • feature_size (str) – frame or phoneme
Returns:

numpy array representation of linguistic features.

Return type:

duration_features (ndarray)

Examples

>>> from nnmnkwii.frontend import merlin as fe
>>> from nnmnkwii.io import hts
>>> from nnmnkwii.util import example_label_file
>>> labels = hts.load(example_label_file())
>>> features = fe.duration_features(labels)
>>> features.shape
(40, 5)