Neural Machine Translation by Seq2Seq Model with Attention layer
This is a sample neural machine translation project with converts english to french. Don't expect it to perform as good as google translate because it had been trained on very small dataset. You can train on big dataset and I'm sure it will perform good.
- It is based on Seq2Seq Rnn model with attention layer.
- Seq2Seq have two main parts, the encoder model and the decoder model.
- The decoder model can be purely Seq2Seq or with a custom attention layer that improves the accuracy of model.
- Python 3+
- Keras with tensorflow backend
- nvidia Gpu (for training purpose as it use CuDNNLSTM layer that is accelerated by CuDNN library by nvidia)
- Numpy
- Fork this repo
- Download the dataset from here .
- Download the GloVe Word embeddings from here.
- Save both data and GloVe embeddings in
data
folder. - If training, make changes in file
utils/config.py
if you want. - Use the
train.ipynb
notebook for training. - If using for test-predictions, download the weights from here and save it in
weights
folder. - Use
test-translations.ipynb
notebook.
- check out Deep NLP course by Lazy Programmer Inc.
- For actual code check his repo.
- Also check out this cool article about Seq2Seq model with attention layer.