G2PTrainer#

class montreal_forced_aligner.g2p.trainer.G2PTrainer(validation_proportion=0.1, num_pronunciations=0, evaluation_mode=False, **kwargs)[source]#

Bases: MfaWorker, TrainerMixin

Abstract mixin class for G2P training

Parameters:
  • validation_proportion (float) – Proportion of words to use as the validation set, defaults to 0.1, only used if evaluate is True

  • num_pronunciations (int) – Number of pronunciations to generate

  • evaluation_mode (bool) – Flag for whether to evaluate the model performance on an validation set

See also

MfaWorker

For base MFA parameters

TrainerMixin

For base trainer parameters

Variables:
  • g2p_training_dictionary (dict[str, list[str]]) – Dictionary of words to pronunciations to train from

  • g2p_validation_dictionary (dict[str, list[str]]) – Dictionary of words to pronunciations to validate performance against

  • g2p_graphemes (set[str]) – Set of graphemes in the training set