Code Monkey home page Code Monkey logo

seq2seq-2's Introduction

Introduction:

This is my first attempt on a simple project to create a language translation model using Sequence To Sequence Learning Approach.

Details can be found at my blog post here:

Dataset:

I used the Europarl's Parallel Corpus for training. To get the source code to work immediately, you have to use the newest version (release v8 at the time of writing) at the link below (following the link will start a 180MB download):

Feel free to change the default dataset to anyone of your own. Just don't forget to modify the code!

List of arguments:

  • max_len: specify the maximum length of sentence to extract from text.
    Default: 200
  • vocab_size: specify the number of the most frequent words to put in vocabulary set.
    Default: 20000
  • batch_size: specify the batch size.
    Default: 1000
  • layer_num: specify the number of recurrent layers in Decoder network.
    Default: 3
  • hidden_dim: specify the dimension of hidden state.
    Default: 1000
  • np_epoch: specify the number of training epochs.
    Default: 20
  • mode: specify whether to train or test the model.
    Default: train

Train the model:

  • With default settings:
python seq2seq.py
  • With user-defined settings:
# Max length:= 300, number of recurrent layers:= 2, dimension of hidden state:= 500
python seq2seq.py -max_len 300 -layer_num 2 -hidden_dim 500

Test the model:

The network must be trained at least once (trained weights must exist!).

  • If the network was trained with default settings:
python seq2seq.py -mode test
  • If the network was trained with user-defined settings:
# Max length:= 300, number of recurrent layers:= 2, dimension of hidden state:= 500
python seq2seq.py -mode test -max_len 300 -layer_num 2 -hidden_dim 500

seq2seq-2's People

Contributors

reactjsx avatar

Watchers

James Cloos 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.