AcousticModel#

class montreal_forced_aligner.models.AcousticModel(source, root_directory=None)[source]#

Bases: Archive, AcousticModel

Class for storing acoustic models in MFA, exported as zip files containing the necessary Kaldi files to be reused

add_meta_file(trainer)[source]#

Add metadata file from a model trainer

Parameters:

trainer (ModelExporterMixin) – Trainer to supply metadata information about the acoustic model

add_model(source)[source]#

Add file into archive

Parameters:

source (str) – File to add

add_pronunciation_models(source, dictionary_base_names)[source]#

Add file into archive

Parameters:
  • source (str) – File to add

  • dictionary_base_names (list[str]) – Base names of dictionaries to add pronunciation models

export_model(destination)[source]#

Extract the model files to a new directory

Parameters:

destination (str) – Destination directory to extract files to

log_details()[source]#

Log metadata information to a logger

property parameters#

Parameters to pass to top-level workers

pretty_print()[source]#

Prints the metadata information to the terminal

property rules_path#

Path to phone symbol table

validate(dictionary)[source]#

Validate this acoustic model against a pronunciation dictionary to ensure their phone sets are compatible

Parameters:

dictionary (DictionaryMixin) – DictionaryMixin to compare phone sets with

Raises:

PronunciationAcousticMismatchError – If there are phones missing from the acoustic model