Archive#
- class montreal_forced_aligner.models.Archive(source, root_directory=None)[source]#
Bases:
MfaModel
Class representing data in a directory or archive file (zip, tar, tar.gz/tgz)
Based on the prosodylab-aligner (prosodylab/Prosodylab-Aligner) archive class.
- Parameters:
- add(source)[source]#
Add file into archive
- Parameters:
source (str) – Path to file to copy into the directory
- add_meta_file(trainer)[source]#
Add a metadata file from a given trainer to the model
- Parameters:
trainer (
ModelExporterMixin
) – The trainer to construct the metadata from
- classmethod empty(head, root_directory=None)[source]#
Initialize an archive using an empty directory
- Parameters:
- Returns:
Model constructed from the empty directory
- Return type:
Archive
,AcousticModel
,G2PModel
,LanguageModel
,TokenizerModel
, orIvectorExtractorModel
- classmethod generate_path(root, name, enforce_existence=True)[source]#
Generate a path for a given model from the root directory and the name of the model
- get_subclass_object()[source]#
Instantiate subclass models based on files contained in the archive
- Returns:
Subclass model that was auto detected
- Return type:
AcousticModel
,G2PModel
,LanguageModel
, orIvectorExtractorModel
- Raises:
ModelLoadError – If the model type cannot be determined
- property meta#
Get the meta data associated with the model
- model_type = None#