AcousticModel#

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

Bases: Archive

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

property alignment_model_path#

Alignment model path

export_model(destination)[source]#

Extract the model files to a new directory

Parameters:

destination (str) – Destination directory to extract files to

property lda_mat_path#

Current acoustic model path

property lda_options#

Parameters to use in computing MFCC features.

log_details()[source]#

Log metadata information to a logger

property meta#

Metadata information for the acoustic model

property mfcc_options#

Parameters to use in computing MFCC features.

property model_path#

Current acoustic model path

property parameters#

Parameters to pass to top-level workers

property phone_symbol_path#

Path to phone symbol table

property pitch_options#

Parameters to use in computing MFCC features.

pretty_print()[source]#

Prints the metadata information to the terminal

property rules_path#

Path to phone symbol table

property tree_path#

Current acoustic model path

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