All Projects → hajix → G2P

hajix / G2P

Licence: other
Grapheme To Phoneme

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to G2P

Bamnet
Code & data accompanying the NAACL 2019 paper "Bidirectional Attentive Memory Networks for Question Answering over Knowledge Bases"
Stars: ✭ 140 (+137.29%)
Mutual labels:  attention-model
Generative Inpainting Pytorch
A PyTorch reimplementation for paper Generative Image Inpainting with Contextual Attention (https://arxiv.org/abs/1801.07892)
Stars: ✭ 242 (+310.17%)
Mutual labels:  attention-model
g2pK
g2pK: g2p module for Korean
Stars: ✭ 137 (+132.2%)
Mutual labels:  g2p
Pytorch Acnn Model
code of Relation Classification via Multi-Level Attention CNNs
Stars: ✭ 170 (+188.14%)
Mutual labels:  attention-model
Generative inpainting
DeepFill v1/v2 with Contextual Attention and Gated Convolution, CVPR 2018, and ICCV 2019 Oral
Stars: ✭ 2,659 (+4406.78%)
Mutual labels:  attention-model
Sinet
Camouflaged Object Detection, CVPR 2020 (Oral & Reported by the New Scientist Magazine)
Stars: ✭ 246 (+316.95%)
Mutual labels:  attention-model
Linear Attention Recurrent Neural Network
A recurrent attention module consisting of an LSTM cell which can query its own past cell states by the means of windowed multi-head attention. The formulas are derived from the BN-LSTM and the Transformer Network. The LARNN cell with attention can be easily used inside a loop on the cell state, just like any other RNN. (LARNN)
Stars: ✭ 119 (+101.69%)
Mutual labels:  attention-model
asr24
24-hour Automatic Speech Recognition
Stars: ✭ 27 (-54.24%)
Mutual labels:  g2p
Pytorch Batch Attention Seq2seq
PyTorch implementation of batched bi-RNN encoder and attention-decoder.
Stars: ✭ 245 (+315.25%)
Mutual labels:  attention-model
DeepPhonemizer
Grapheme to phoneme conversion with deep learning.
Stars: ✭ 152 (+157.63%)
Mutual labels:  g2p
Snli Entailment
attention model for entailment on SNLI corpus implemented in Tensorflow and Keras
Stars: ✭ 181 (+206.78%)
Mutual labels:  attention-model
Keras Attention Mechanism
Attention mechanism Implementation for Keras.
Stars: ✭ 2,504 (+4144.07%)
Mutual labels:  attention-model
myG2P
Myanmar (Burmese) Language Grapheme to Phoneme (myG2P) Conversion Dictionary for speech recognition (ASR) and speech synthesis (TTS).
Stars: ✭ 43 (-27.12%)
Mutual labels:  g2p
Sa Tensorflow
Soft attention mechanism for video caption generation
Stars: ✭ 154 (+161.02%)
Mutual labels:  attention-model
commonvoice-utils
Linguistic processing for Common Voice
Stars: ✭ 32 (-45.76%)
Mutual labels:  g2p
Image Caption Generator
A neural network to generate captions for an image using CNN and RNN with BEAM Search.
Stars: ✭ 126 (+113.56%)
Mutual labels:  attention-model
Attentionalpoolingaction
Code/Model release for NIPS 2017 paper "Attentional Pooling for Action Recognition"
Stars: ✭ 248 (+320.34%)
Mutual labels:  attention-model
swin-transformer-pytorch
Implementation of the Swin Transformer in PyTorch.
Stars: ✭ 610 (+933.9%)
Mutual labels:  attention-model
wikipron
Massively multilingual pronunciation mining
Stars: ✭ 167 (+183.05%)
Mutual labels:  g2p
multilingual-g2p
Multilingual Grapheme to Phoneme
Stars: ✭ 40 (-32.2%)
Mutual labels:  g2p

Attention Based Grapheme To Phoneme

The G2P algorithm is used to generate the most probable pronunciation for a word not contained in the lexicon dictionary. It could be used as a preprocess of text-to-speech system to generate pronunciation for OOV words.

Dependencies

The following libraries are used:
pytorch
tqdm
matplotlib

Install dependencies using pip:

pip3 install -r requirements.txt

Dataset

Currently the following languages are supported:

  1. EN: English
  2. FA: Farsi
  3. RU: Russian

You could easily provide and use your own language specific pronunciatin doctionary for training G2P. More details about data preparation and contribution could be found in resources.
Feel free to provide resources for other languages.

Attention Model

Both encoder-decoder seq2seq model and attention model could handle G2P problem. Here we train attention based model. attention model The encoder model get sequence of graphemes and produces states at each timestep. Encoder states used during attention decoding. The decoder attends to appropriate encoder state (according to its state) and produces phonemes.

Train

To start training the model run:

LANGUAGE=[EN|FA|RU] python train.py

You can also use tensorboard to check the training loss:

tensorboard --logdir log --bind_all

Training parameters could be found at config.py.

Test

To get pronunciation of a word:

# RU example
python test.py --word питон
u0.d.a0.lj.o1.n.k.a0.<eos>
# EN example
python test.py --word PYTHON
P.IH.TH.AH.N.<eos>
# FA example
python test.py --word پایتون
p.A.y.t.o.n.<eos>

You could also visualize the attention weights, using --visualize:

EN FA RU

Other implementations

Also check Persian_G2P, for encoder-decoder seq2seq model implementation.

A C++ implementation that relies on trained models of this repository, could be found here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].