paddlespeech.t2s.frontend.zh_frontend module
- class paddlespeech.t2s.frontend.zh_frontend.Frontend(g2p_model='g2pW', phone_vocab_path=None, tone_vocab_path=None, use_rhy=False)[source]
Bases:
object
Methods
add_sp_if_no
(phonemes)Prosody mark #4 added at sentence end.
get_phonemes
(sentence[, merge_sentences, ...])Main function to do G2P
get_phonemes_ssml
(ssml_inputs[, ...])Main function to do G2P with SSML support.
get_input_ids
get_input_ids_ssml
- get_input_ids(sentence: str, merge_sentences: bool = True, get_tone_ids: bool = False, robot: bool = False, print_info: bool = False, add_blank: bool = False, blank_token: str = '<pad>', to_tensor: bool = True) Dict[str, List[Tensor]] [source]
- get_input_ids_ssml(sentence: str, merge_sentences: bool = True, get_tone_ids: bool = False, robot: bool = False, print_info: bool = False, add_blank: bool = False, blank_token: str = '<pad>', to_tensor: bool = True) Dict[str, List[Tensor]] [source]