montreal_forced_aligner.helper.output_mapping(mapping, path, skip_safe=False)[source]#

Helper function to save mapping information (i.e., utt2spk) in Kaldi scp format

CorpusMappingType is either a dictionary of key to value for one-to-one mapping case and a dictionary of key to list of values for one-to-many case.

  • mapping (dict[str, Any]) – Mapping to output

  • path (Path) – Path to save mapping

  • skip_safe (bool, optional) – Flag for whether to skip over making a string safe