All Projects → wang-h → pynmt

wang-h / pynmt

Licence: other
a simple and complete pytorch implementation of neural machine translation system

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects
perl
6916 projects

Projects that are alternatives of or similar to pynmt

Nmt Keras
Neural Machine Translation with Keras
Stars: ✭ 501 (+3753.85%)
Mutual labels:  transformer, nmt, attention-mechanism
Sockeye
Sequence-to-sequence framework with a focus on Neural Machine Translation based on Apache MXNet
Stars: ✭ 990 (+7515.38%)
Mutual labels:  translation, transformer, attention-mechanism
Njunmt Tf
An open-source neural machine translation system developed by Natural Language Processing Group, Nanjing University.
Stars: ✭ 97 (+646.15%)
Mutual labels:  translation, transformer, nmt
Transformer
A TensorFlow Implementation of the Transformer: Attention Is All You Need
Stars: ✭ 3,646 (+27946.15%)
Mutual labels:  translation, transformer, attention-mechanism
Transformers-RL
An easy PyTorch implementation of "Stabilizing Transformers for Reinforcement Learning"
Stars: ✭ 107 (+723.08%)
Mutual labels:  transformer, attention-mechanism
Pytorch Transformer
pytorch implementation of Attention is all you need
Stars: ✭ 199 (+1430.77%)
Mutual labels:  translation, transformer
En-transformer
Implementation of E(n)-Transformer, which extends the ideas of Welling's E(n)-Equivariant Graph Neural Network to attention
Stars: ✭ 131 (+907.69%)
Mutual labels:  transformer, attention-mechanism
NLP-paper
🎨 🎨NLP 自然语言处理教程 🎨🎨 https://dataxujing.github.io/NLP-paper/
Stars: ✭ 23 (+76.92%)
Mutual labels:  transformer, attention-mechanism
Keras Attention
Visualizing RNNs using the attention mechanism
Stars: ✭ 697 (+5261.54%)
Mutual labels:  translation, attention-mechanism
h-transformer-1d
Implementation of H-Transformer-1D, Hierarchical Attention for Sequence Learning
Stars: ✭ 121 (+830.77%)
Mutual labels:  transformer, attention-mechanism
dodrio
Exploring attention weights in transformer-based models with linguistic knowledge.
Stars: ✭ 233 (+1692.31%)
Mutual labels:  transformer, attention-mechanism
Onnxt5
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Stars: ✭ 143 (+1000%)
Mutual labels:  translation, transformer
OverlapPredator
[CVPR 2021, Oral] PREDATOR: Registration of 3D Point Clouds with Low Overlap.
Stars: ✭ 293 (+2153.85%)
Mutual labels:  transformer, attention-mechanism
TianChi AIEarth
TianChi AIEarth Contest Solution
Stars: ✭ 57 (+338.46%)
Mutual labels:  transformer, attention-mechanism
visualization
a collection of visualization function
Stars: ✭ 189 (+1353.85%)
Mutual labels:  transformer, attention-mechanism
enformer-pytorch
Implementation of Enformer, Deepmind's attention network for predicting gene expression, in Pytorch
Stars: ✭ 146 (+1023.08%)
Mutual labels:  transformer, attention-mechanism
CrabNet
Predict materials properties using only the composition information!
Stars: ✭ 57 (+338.46%)
Mutual labels:  transformer, attention-mechanism
Image-Caption
Using LSTM or Transformer to solve Image Captioning in Pytorch
Stars: ✭ 36 (+176.92%)
Mutual labels:  transformer, attention-mechanism
Rust Bert
Rust native ready-to-use NLP pipelines and transformer-based models (BERT, DistilBERT, GPT2,...)
Stars: ✭ 510 (+3823.08%)
Mutual labels:  translation, transformer
Quality-Estimation1
机器翻译子任务-翻译质量评价-复现 WMT2018 阿里论文结果
Stars: ✭ 19 (+46.15%)
Mutual labels:  transformer, nmt

Neural Machine Translation System (Pytorch)

State-of-the-art NMT systems are difficult to understand.

For the beginners, I highly recommend this project, which is a simplified version of Opennmt-py.

Though some modules reference to OpenNMT-py, most of the code (80%) is written by myself. With the scripts that I posted, you can even build your own NMT systems and evaluate them on WMT 2018 datasets.

REQUIREMENTS

(I implemented it with Pytorch 0.4. ) Python version >= 3.6 (recommended) Pytorch version >= 0.4 (recommended)

Usage

For training, please use a Moses-style configuration file to specify paths and hyper-parameters.

 python train.py --config config/nmt.ini

For translation,

python translate.py --config config/nmt.ini --checkpoint {pretrained_model.pt} -v

A known bug is that beam_search does not support batch decoding: when using beam_search = True, you need to set test_batch_size=1 to make the output correct.

For monotonic decoding (without beam_search), you can use any number for test_batch_size.

Optimizer

  • LSTM:

    SGD 1.0 learning_rate_decay as 0.9 (recommended)

  • GRU:

    Adam 1e-4 max_grad_norm = 5 (recommended)

  • Transformer:

    Adam 1e-4, grad_accum_count = 4~5, label_smoothing=0.1 (recommended)

References

  1. Vaswani, Ashish, et al. "Attention is all you need." Advances in Neural Information Processing Systems. 2017

  2. Luong, Minh-Thang, Hieu Pham, and Christopher D. Manning. "Effective approaches to attention-based neural machine translation." arXiv preprint arXiv:1508.04025 (2015).

  3. Bahdanau, Dzmitry, Kyunghyun Cho, and Yoshua Bengio. "Neural machine translation by jointly learning to align and translate." arXiv preprint arXiv:1409.0473 (2014).

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].