G2PW is a neural network model that converts Chinese (Mandarin) graphemes (characters) into phonemes.
你好世界
pinyin style
[ni3, hao3, shi4, jie4]
bopomofo style
[ㄋㄧ3, ㄏㄠ3, ㄕ4, ㄐㄧㄝ4]
Please ensure that the ONNX file is placed in the G2PWModel/ directory.
To run with the default text:
$ python3 g2pw.pyTo specify custom text:
$ python3 g2pw.py --input '你好世界'To specify the outout style:
[pinyin]
$ python3 g2pw.py --style pinyin[Bopomofo]
$ python3 g2pw.py --style bopomofoONNX opset=12
Python 3.6.13