PyniniGenerator#

class montreal_forced_aligner.g2p.generator.PyniniGenerator(g2p_model_path=None, strict_graphemes=False, **kwargs)[source]#

Bases: G2PTopLevelMixin

Class for generating pronunciations from a Pynini G2P model

Parameters:
  • g2p_model_path (str) – Path to G2P model

  • strict_graphemes (bool) – Flag for whether to be strict with missing graphemes and skip words containing new graphemes

See also

G2PTopLevelMixin

For top level G2P generation parameters

Variables:

g2p_model (G2PModel) – G2P model

generate_pronunciations()[source]#

Generate pronunciations

Returns:

Mappings of keys to their generated pronunciations

Return type:

dict[str, list[str]]