espnet3.systems.f5tts.src.pinyin.convert_char_to_pinyin
Less than 1 minute
espnet3.systems.f5tts.src.pinyin.convert_char_to_pinyin
espnet3.systems.f5tts.src.pinyin.convert_char_to_pinyin(text_list: List[str], polyphone: bool = True) → List[List[str]]
F5-TTS tokenizer: hanzi -> pinyin syllables, else char-level.
- Parameters:
- text_list – Raw transcripts. Each entry is tokenized independently.
- polyphone – Enable pypinyin polyphone handling and tone sandhi for pure east-asian segments.
- Returns: One token list per input string, in the same order.
Example
>>> convert_char_to_pinyin(["hello"])
[['h', 'e', 'l', 'l', 'o']]
>>> convert_char_to_pinyin(["中文"])
[[' ', 'zhong1', ' ', 'wen2']]NOTE
This is F5’s “Emilia_ZH_EN_pinyin” scheme, not “pinyin for English”: Chinese becomes Style.TONE3 syllables each preceded by a space, while English stays character-level. rjieba runs on every input, English included, so both optional dependencies are needed even for English-only text. Output depends on the installed rjieba / pypinyin versions.
