Code Monkey home page Code Monkey logo

english-to-vietnamese-nmt-model's Introduction

A Seq2seq Model with Attention Mechanism in Neural Machine Translation

โ€”โ€”by ccr

20.1.31

Network Architecture

Transformer model, with positional encoding.

Usage

Run following to start training.

python3 main.py train

The script accepts following optional argument:

optional arguments:
  -h, --help            show this help message and exit
  --lr                  initial learning rate [default: 5e-4]
  --lr-decay            learning rate decay factor [default: 0.5]
  --patience            patience before lr decay [default: 3]
  --num-epoch           number of training epochs [default:20]
  --num-layer           number of layers in encoder and decoder [default: 6]
  --batch-size          batch size [default: 64]
  --embed-size          embedding size (d_model) [default: 256]
  --hidden-size         hidden size (in the feedforward layers) [default: 512]
  --max-length          max length to trim the dataset [default: 64]
  --clip-grad           parameter clipping threshold [default: 1.0]
  --print-every         print training procedure every number of batches [default: 100]
  --save-path           model path for saving  [default: 'NMT.pt']
  --checkpoint          checkpoint for resuming training [default: '']

Run following to start testing.

python3 main.py test --model [model file]

File Structure

main.py is the main file where training and testing occurs.

transformerModel.py defines the Transformer model.

./en_vi stores the raw data of English/Vietnamese dataset.

Results

BLEU score on valid dataset: 26.81

BLEU score on test dataset: 24.77

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.