Giter VIP home page Giter VIP logo

neural_quality_estimation's Introduction

Machine Translation Quality Estimation

Training and inference code from the paper A Recurrent Neural Networks Approach for Estimating the Quality of Machine Translation Output

There are four subdirectories:

qualvec

Using a parallel corpora, trains the neural machine translation (encoder-decoder-attention) model with two modifications 1) Both the encoder and decoder are bidirectional 2) introduce another hidden layer between maxout and the projection matrix in the decoder. During inference, instead of predicting the next word, we take the element-wise multiplication of the row vector from the projection matrix of the translated word and the additional hidden layer's node values from prediction to create an array of quality vectors (See paper for more details). Training data for quality estimation are then run through this model to obtain the quality vectors as input to qescore. This code was modified from the tensorflow seq2seq example.

qescore

The 2nd step to training the quality estimation model. Takes the quality vector from qualvec, runs a GRU RNN on it and use last hidden state to predict the HTER score. Currently uses L2 loss, which is unstable, but should modify to use loss function from this paper for better stability.

paradet

Similar to qualvec except uses "general" attention from Effective Approaches to Attention-based Neural Machine Translation which worked better. Will merge with qualvec.

baseline_svr

Get the baseline score using Support Vector Regression on baseline features. Hyperparameters are optimized using particle swarm optimization.

To Train:

Tokenize text with the moses tokenizer

For training NMT model:

python qualvec/qualvec.py --data_dir <data directory containing parallel corpora> --train_dir <training dir>

For obtaining quality vectors

python qualvec/qualvec.py --data_dir <data directory containing quality estimation data> --train_dir <training dir> --qualvec

training quality estimation model

python qescore/qe.py --data_dir <data directory containing quality vectors and labels> --train_dir <training dir>

quality estimation inference

python qescore/qe.py --data_dir <data directory containing training vectors> --train_dir <training dir> --qescore

See source code for additional options

neural_quality_estimation's People

Contributors

cliffrwong avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.