All Projects → yistLin → Pytorch Dual Learning

yistLin / Pytorch Dual Learning

Implementation of Dual Learning NMT on PyTorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch Dual Learning

Machine Translation
Stars: ✭ 51 (-63.83%)
Mutual labels:  machine-translation
Niutrans.smt
NiuTrans.SMT is an open-source statistical machine translation system developed by a joint team from NLP Lab. at Northeastern University and the NiuTrans Team. The NiuTrans system is fully developed in C++ language. So it runs fast and uses less memory. Currently it supports phrase-based, hierarchical phrase-based and syntax-based (string-to-tree, tree-to-string and tree-to-tree) models for research-oriented studies.
Stars: ✭ 90 (-36.17%)
Mutual labels:  machine-translation
Cluedatasetsearch
搜索所有中文NLP数据集,附常用英文NLP数据集
Stars: ✭ 2,112 (+1397.87%)
Mutual labels:  machine-translation
Thot
Thot toolkit for statistical machine translation
Stars: ✭ 53 (-62.41%)
Mutual labels:  machine-translation
Transformers without tears
Transformers without Tears: Improving the Normalization of Self-Attention
Stars: ✭ 80 (-43.26%)
Mutual labels:  machine-translation
En Fr Mlt Tensorflow
English-French Machine Language Translation in Tensorflow
Stars: ✭ 99 (-29.79%)
Mutual labels:  machine-translation
Bartycrouch
Localization/I18n: Incrementally update/translate your Strings files from .swift, .h, .m(m), .storyboard or .xib files.
Stars: ✭ 1,032 (+631.91%)
Mutual labels:  machine-translation
Tokenizer
Fast and customizable text tokenization library with BPE and SentencePiece support
Stars: ✭ 132 (-6.38%)
Mutual labels:  machine-translation
Opennmt Tf
Neural machine translation and sequence learning using TensorFlow
Stars: ✭ 1,223 (+767.38%)
Mutual labels:  machine-translation
Nonautoreggenprogress
Tracking the progress in non-autoregressive generation (translation, transcription, etc.)
Stars: ✭ 118 (-16.31%)
Mutual labels:  machine-translation
Comet
A Neural Framework for MT Evaluation
Stars: ✭ 58 (-58.87%)
Mutual labels:  machine-translation
Chinesenlp
Datasets, SOTA results of every fields of Chinese NLP
Stars: ✭ 1,206 (+755.32%)
Mutual labels:  machine-translation
Mt Paper Lists
MT paper lists (by conference)
Stars: ✭ 105 (-25.53%)
Mutual labels:  machine-translation
Fasttext multilingual
Multilingual word vectors in 78 languages
Stars: ✭ 1,067 (+656.74%)
Mutual labels:  machine-translation
Gtos
Code for AAAI2020 paper "Graph Transformer for Graph-to-Sequence Learning"
Stars: ✭ 129 (-8.51%)
Mutual labels:  machine-translation
Mtnt
Code for the collection and analysis of the MTNT dataset
Stars: ✭ 48 (-65.96%)
Mutual labels:  machine-translation
Deep Learning Drizzle
Drench yourself in Deep Learning, Reinforcement Learning, Machine Learning, Computer Vision, and NLP by learning from these exciting lectures!!
Stars: ✭ 9,717 (+6791.49%)
Mutual labels:  machine-translation
Subword Nmt
Unsupervised Word Segmentation for Neural Machine Translation and Text Generation
Stars: ✭ 1,819 (+1190.07%)
Mutual labels:  machine-translation
Awesome Ai Services
An overview of the AI-as-a-service landscape
Stars: ✭ 133 (-5.67%)
Mutual labels:  machine-translation
Opus Mt
Open neural machine translation models and web services
Stars: ✭ 111 (-21.28%)
Mutual labels:  machine-translation

PyTorch Dual Learning

This is the PyTorch implementation for Dual Learning for Machine Translation.

The NMT models used as channels are heavily depend on pcyin/pytorch_nmt.

Usage

You shall prepare these models for dual learning step:

  • Language Models x 2
  • Translation Models x 2
Warm-up Step
  • Language Models
    Check here lm/
  • Translation Models
    Check here nmt/
Dual Learning Step

During the reinforcement learning process, it will gain rewards from language models and translation models, and update the translation models.
You can find more details in the paper.

  • Training
    You can simply use this script, you have to modify the path and name to your models.
  • Test
    To use the trained models, you can just treat it as NMT models.

Test (Basic)

Firstly, we trained our basic model with 450K bilingual pair, which is only 10% data, as warm-start. Then, we set up a dual-learning game, and trained two models using reinforcement technique.

Configs
  • Reward

    • language model reward: average over square rooted length of string
    • final reward:
      rk = 0.01 x r1 + 0.99 x r2
      
  • Optimizer

    torch.optim.SGD(models[m].parameters(), lr=1e-3, momentum=0.9)
    
Results
  • English-Deutsch

    • after 600 iterations
      BLEU = 21.39, 49.1/26.8/17.6/12.2
      
    • after 1200 iterations
      BLEU = 21.49, 48.6/26.6/17.4/12.0
      
  • Deutsch-English

    • after 600 iterations
      BLEU = 25.89, 56.0/32.8/22.3/15.8
      
    • after 1200 iterations
      BLEU = 25.94, 55.9/32.7/22.2/15.8
      
Comparisons
Model Original iter300 iter600 iter900 iter1200 iter1500 iter3000 iter4500 iter6600
EN-DE 20.54 21.27 21.39 21.49 21.46 21.49 21.56 21.62 21.60
EN-DE (bleu) 21.42 21.57 21.55 21.55
DE-EN 24.69 25.90 25.89 25.91 26.03 25.94 26.02 26.18 26.20
DE-EN (bleu) 25.96 26.25 26.22 26.18
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].