Downloads · 30 days
15
2% of all-time downloads
bene-ges/ru_g2p_ipa_bert_large
ru_g2p_ipa_bert_large is a token classification model from bene-ges. Use it when you need labels on individual words, such as names. It is set up for nemo. The card lists the license as cc-by-4.0.
This is a non-autoregressive model for Russian grapheme-to-phoneme (G2P) conversion based on BERT architecture. It predicts phonemes in IPA format. Initial data was built using Wiktionary json from https://kaikki.org/…
Downloads · 30 days
15
2% of all-time downloads
All-time downloads
736
Public
Repo size
1.5 GB
Likes
5
Public
Click a slice to open those files.
.nemo720 MB · 95%
From the Hugging Face model README
This is a non-autoregressive model for Russian grapheme-to-phoneme (G2P) conversion based on BERT architecture. It predicts phonemes in IPA format. Initial data was built using Wiktionary json from https://kaikki.org/dictionary/Russian/index.html
The input is expected to consist of cyrillic letters separated by space. Real space should be replaced to underscore(_). Note that the model was trained on single words and some short phrases. Though it can accept longer phrases its accuracy may degrade on them.
Install NeMo.
Download ru_g2p.nemo (this model)
git lfs install
git clone https://huggingface.co/bene-ges/ru_g2p_ipa_bert_large
Run
python ${NEMO_ROOT}/examples/nlp/text_normalization_as_tagging/normalization_as_tagging_infer.py \
pretrained_model=ru_g2p_ipa_bert_large/ru_g2p.nemo \
inference.from_file=input.txt \
inference.out_file=output.txt \
model.max_sequence_len=512 \
inference.batch_size=128 \
lang=ru
Example of input file:
и с х о д
т р а н с н е п т у н о в ы х
т е л я т н и к о в с к о е
ц а р с к о г о
к р о с х о ф
г а н с - ю р г е н
д а р д а н е л л
Example of output file:
ɪ s x 'o t и с х о д ɪ s x 'o t ɪ s x 'o t PLAIN PLAIN PLAIN PLAIN PLAIN
t r a nʲ sʲ nʲ ɪ p t 'u n ə v ɨ x т р а н с н е п т у н о в ы х t r a nʲ sʲ nʲ ɪ p t 'u n ə v ɨ x t r a nʲ sʲ nʲ ɪ p t 'u n ə v ɨ x PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN
tʲ ɪ lʲ 'æ tʲ nʲ ɪ k ə f s k ə jə т е л я т н и к о в с к о е tʲ ɪ lʲ 'æ tʲ nʲ ɪ k ə f s k ə jə tʲ ɪ lʲ 'æ tʲ nʲ ɪ k ə f s k ə jə PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN
t~s 'a r s k ə v ə ц а р с к о г о t~s 'a r s k ə v ə t~s 'a r s k ə v ə PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN
k r ɐ s x 'o f к р о с х о ф k r ɐ s x 'o f k r ɐ s x 'o f PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN
ɡ a n s 'ju r ɡʲ ɪ n г а н с - ю р г е н ɡ a n s _ 'ju r ɡʲ ɪ n ɡ a n s _ 'ju r ɡʲ ɪ n PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN
d ə r d ɐ n 'ɛ ɫ д а р д а н е л л d ə r d ɐ n 'ɛ ɫ <DELETE> d ə r d ɐ n 'ɛ ɫ <DELETE> PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN PLAIN
Note that the correct output tags are in the third column, input is in the second column.
Tags correspond to input letters in a one-to-one fashion. If you remove <DELETE> tag, +, ~, and spaces, you should get IPA-like transcription.
The model does not predict secondary stress. The primary stress is put directly before the stressed vowel. In some cases stress can be missing.
See example of inference pipeline for G2P + FastPitch + HifiGAN in this notebook.