align_phones#
- montreal_forced_aligner.helper.align_phones(ref, test, silence_phone, ignored_phones=None, custom_mapping=None, debug=False)[source]#
Align phones based on how much they overlap and their phone label, with the ability to specify a custom mapping for different phone labels to be scored as if they’re the same phone
- Parameters:
ref (list[
CtmInterval]) – List of CTM intervals as referencetest (list[
CtmInterval]) – List of CTM intervals to compare to referencesilence_phone (str) – Silence phone (these are ignored in the final calculation)
custom_mapping (dict[str, str], optional) – Mapping of phones to treat as matches even if they have different symbols
- Returns:
float – Score based on the average amount of overlap in phone intervals
float – Phone error rate