File size: 299 Bytes
8ae12c1
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
Cleaners:
def chinese_cleaners(text):
    from pypinyin import Style, pinyin

    phones = [phone[0] for phone in pinyin(text, style=Style.TONE3)]
    return ' '.join(phones)

Symbols:
'_;:,。!?-“”《》、()…— ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123450BP'