espnet2.text.phoneme_tokenizer.pyopenjtalk_g2p
Less than 1 minute
espnet2.text.phoneme_tokenizer.pyopenjtalk_g2p
espnet2.text.phoneme_tokenizer.pyopenjtalk_g2p(text) → List[str]
Converts input text to phonemes using the pyopenjtalk library.
This function utilizes the pyopenjtalk library to perform grapheme-to-phoneme (G2P) conversion, generating a list of phonemes represented as strings.
- Parameters:text (str) – The input text that needs to be converted to phonemes.
- Returns: A list of phonemes extracted from the input text.
- Return type: List[str]
Examples
>>> phonemes = pyopenjtalk_g2p("こんにちは。")
>>> print(phonemes)
['k', 'o', 'N', 'n', 'i', 'ch', 'i', 'w', 'a']
NOTE
The input text should be in Japanese for accurate phoneme extraction. Ensure that the pyopenjtalk library is installed and available in your environment.