Views
No views yet
1pip install speechbrain
2pip install transformers1from speechbrain.inference.text import GraphemeToPhoneme
2g2p = GraphemeToPhoneme.from_hparams("speechbrain/soundchoice-g2p", savedir="pretrained_models/soundchoice-g2p")
3text = "To be or not to be, that is the question"
4phonemes = g2p(text)1>>> phonemes
2['T', 'UW', ' ', 'B', 'IY', ' ', 'AO', 'R', ' ', 'N', 'AA', 'T', ' ', 'T', 'UW', ' ', 'B', 'IY', ' ', 'DH', 'AE', 'T', ' ', 'IH', 'Z', ' ', 'DH', 'AH', ' ', 'K', 'W', 'EH', 'S', 'CH', 'AH', 'N']1items = [
2 "All's Well That Ends Well",
3 "The Merchant of Venice",
4 "The Two Gentlemen of Verona",
5 "The Comedy of Errors"
6]
7transcriptions = g2p(items)1>>> transcriptions
2[['AO', 'L', 'Z', ' ', 'W', 'EH', 'L', ' ', 'DH', 'AE', 'T', ' ', 'EH', 'N', 'D', 'Z', ' ', 'W', 'EH', 'L'], ['DH', 'AH', ' ', 'M', 'ER', 'CH', 'AH', 'N', 'T', ' ', 'AH', 'V', ' ', 'V', 'EH', 'N', 'AH', 'S'], ['DH', 'AH', ' ', 'T', 'UW', ' ', 'JH', 'EH', 'N', 'T', 'AH', 'L', 'M', 'IH', 'N', ' ', 'AH', 'V', ' ', 'V', 'ER', 'OW', 'N', 'AH'], ['DH', 'AH', ' ', 'K', 'AA', 'M', 'AH', 'D', 'IY', ' ', 'AH', 'V', ' ', 'EH', 'R', 'ER', 'Z']]run_opts={"device":"cuda"} when calling the from_hparams method.git clone https://github.com/speechbrain/speechbrain/cd speechbrain
pip install -r requirements.txt
pip install -e .cd recipes/LibriSpeech/G2P
python train.py hparams/hparams_g2p_rnn.yaml --data_folder=your_data_folder1@misc{speechbrain,
2 title={{SpeechBrain}: A General-Purpose Speech Toolkit},
3 author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
4 year={2021},
5 eprint={2106.04624},
6 archivePrefix={arXiv},
7 primaryClass={eess.AS},
8 note={arXiv:2106.04624}
9}1@misc{ploujnikov2022soundchoice,
2 title={SoundChoice: Grapheme-to-Phoneme Models with Semantic Disambiguation},
3 author={Artem Ploujnikov and Mirco Ravanelli},
4 year={2022},
5 eprint={2207.13703},
6 archivePrefix={arXiv},
7 primaryClass={cs.SD}
8}