Views
No views yet
@inproceedings{xphonebert,
title = {{XPhoneBERT: A Pre-trained Multilingual Model for Phoneme Representations for Text-to-Speech}},
author = {Linh The Nguyen and Thinh Pham and Dat Quoc Nguyen},
booktitle = {Proceedings of the 24th Annual Conference of the International Speech Communication Association (INTERSPEECH)},
year = {2023},
pages = {5506--5510}
}transformerstransformers with pip: pip install transformers, or install transformers from source.text2phonemesequence: pip install text2phonemesequence text2phonemesequence package is to convert text sequences into phoneme-level sequences, employed to construct our multilingual phoneme-level pre-training data. We build text2phonemesequence by incorporating the CharsiuG2P and the segments toolkits that perform text-to-phoneme conversion and phoneme segmentation, respectively.text2phonemesequence for each language requires its corresponding ISO 639-3 code. The ISO 639-3 codes of supported languages are available at HERE.text2phonemesequence takes a word-segmented sequence as input. And users might also perform text normalization on the word-segmented sequence before feeding into text2phonemesequence. When creating our pre-training data, we perform word and sentence segmentation on all text documents in each language by using the spaCy toolkit, except for Vietnamese where we employ the VnCoreNLP toolkit. We also use the text normalization component from the NVIDIA NeMo toolkit for English, German, Spanish and Chinese, and the Vinorm text normalization package for Vietnamese.| Model | #params | Arch. | Max length | Pre-training data |
|---|---|---|---|---|
vinai/xphonebert-base | 88M | base | 512 | 330M phoneme-level sentences from nearly 100 languages and locales |
1from transformers import AutoModel, AutoTokenizer
2from text2phonemesequence import Text2PhonemeSequence
3
4# Load XPhoneBERT model and its tokenizer
5xphonebert = AutoModel.from_pretrained("vinai/xphonebert-base")
6tokenizer = AutoTokenizer.from_pretrained("vinai/xphonebert-base")
7
8# Load Text2PhonemeSequence
9# text2phone_model = Text2PhonemeSequence(language='eng-us', is_cuda=True)
10text2phone_model = Text2PhonemeSequence(language='jpn', is_cuda=True)
11
12# Input sequence that is already WORD-SEGMENTED (and text-normalized if applicable)
13# sentence = "That is , it is a testing text ."
14sentence = "これ は 、 テスト テキスト です ."
15
16input_phonemes = text2phone_model.infer_sentence(sentence)
17
18input_ids = tokenizer(input_phonemes, return_tensors="pt")
19
20with torch.no_grad():
21 features = xphonebert(**input_ids)