PyniniCorpusGenerator#

class montreal_forced_aligner.g2p.generator.PyniniCorpusGenerator(per_utterance=False, **kwargs)[source]#

Bases: PyniniGenerator, TextCorpusMixin, TopLevelMfaWorker

Top-level worker for generating pronunciations from a corpus and a Pynini G2P model

See also

PyniniGenerator

For Pynini G2P generation parameters

TextCorpusMixin

For corpus parsing parameters

TopLevelMfaWorker

For top-level parameters

export_file_pronunciations(output_file_path)[source]#

Generate and export per-utterance G2P

Parameters:

output_file_path (Path) – Output directory to save utterance pronunciations

export_pronunciations(output_file_path, export_scores=False, ensure_sorted=False)[source]#

Output pronunciations to text file

Parameters:
  • output_file_path (Path) – Path to save

  • export_scores (bool) – Flag for appending a column for the score of the pronunciation

  • ensure_sorted (bool) – Flag for ensuring that output file is sorted alphabetically

setup()[source]#

Set up the pronunciation generator

property words_to_g2p#

Words to produce pronunciations

property working_directory#

Data directory