g2pW: A Conditional Weighted Softmax BERT for Polyphone Disambiguation in Mandarin
Paper • 2203.10430 • Published
Checkpoints for g2pW, the official implementation of g2pW: A Conditional Weighted Softmax BERT for Polyphone Disambiguation in Mandarin (INTERSPEECH 2022).
| File | Description | SHA256 |
|---|---|---|
G2PWModel-v2.zip |
PyTorch checkpoint (best_accuracy.pth) with config and training log |
6df5312e1a12587f648268960d84d5e380389851484fe64d0fe810c03cbdab97 |
G2PWModel-v2-onnx.zip |
ONNX model used by the g2pw Python package |
699f3c1fd7fb0e2c2d49ed2486826fd5bff233fee7759350a91c3b49aedc4ed2 |
These files were previously hosted at https://storage.googleapis.com/esun-ai/g2pW/.
$ pip install g2pw
>>> from g2pw import G2PWConverter
>>> conv = G2PWConverter() # downloads G2PWModel-v2-onnx.zip from this repo
>>> conv('上校請技術人員校正FN儀器')
[['ㄕㄤ4', 'ㄒㄧㄠ4', 'ㄑㄧㄥ3', 'ㄐㄧ4', 'ㄕㄨ4', 'ㄖㄣ2', 'ㄩㄢ2', 'ㄐㄧㄠ4', 'ㄓㄥ4', None, None, 'ㄧ2', 'ㄑㄧ4']]
Manual download:
$ wget https://huggingface.co/YC-Chen/g2pW/resolve/main/G2PWModel-v2-onnx.zip
$ unzip G2PWModel-v2-onnx.zip
@inproceedings{chen22d_interspeech,
title = {g2pW: A Conditional Weighted Softmax BERT for Polyphone Disambiguation in Mandarin},
author = {Yi-Chang Chen and Yu-Chuan Steven and Yen-Cheng Chang and Yi-Ren Yeh},
year = {2022},
booktitle = {Interspeech 2022},
pages = {1926--1930},
doi = {10.21437/Interspeech.2022-216},
issn = {2958-1796},
}