Transcriber#

class montreal_forced_aligner.transcription.Transcriber(acoustic_model_path, language_model_path, output_type='transcription', **kwargs)[source]#

Bases: TranscriberMixin, TopLevelMfaWorker

Class for performing transcription.

Parameters:
  • acoustic_model_path (str) – Path to acoustic model

  • language_model_path (str) – Path to language model

  • evaluation_mode (bool) – Flag for evaluating generated transcripts against the actual transcripts, defaults to False

See also

TranscriberMixin

For transcription parameters

AcousticCorpusPronunciationMixin

For corpus and dictionary parsing parameters

FileExporterMixin

For file exporting parameters

TopLevelMfaWorker

For top-level parameters

Variables:
create_decoding_graph()[source]#

Create decoding graph for use in transcription

Raises:

KaldiProcessingError – If there were any errors in running Kaldi binaries

create_hclgs()[source]#

Create HCLG.fst files for every dictionary being used by a Transcriber

create_hclgs_arguments()[source]#

Generate Job arguments for CreateHclgFunction

Returns:

Per dictionary arguments for HCLG

Return type:

dict[str, CreateHclgArguments]

export_files(output_directory, output_format=None, include_original_text=False)[source]#

Export transcriptions

Parameters:
  • output_directory (str) – Directory to save transcriptions

  • output_format (str, optional) – Format to save alignments, one of ‘long_textgrids’ (the default), ‘short_textgrids’, or ‘json’, passed to praatio

classmethod parse_parameters(config_path=None, args=None, unknown_args=None)[source]#

Parse configuration parameters from a config file and command line arguments

Parameters:
  • config_path (Path, optional) – Path to yaml configuration file

  • args (dict[str, Any]) – Parsed arguments

  • unknown_args (list[str]) – Optional list of arguments that were not parsed

Returns:

Dictionary of specified configuration parameters

Return type:

dict[str, Any]

setup()[source]#

Set up transcription