Giter Site home page Giter Site logo

stevenlol / sockeye Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awslabs/sockeye

0.0 2.0 0.0 107 KB

Sequence-to-sequence framework with MXNet with a focus on Neural Machine Translation

License: Apache License 2.0

Shell 0.46% Python 99.54%

sockeye's Introduction

Sockeye

Documentation Status

This package contains the Sockeye project, a sequence-to-sequence framework for Neural Machine Translation based on MXNet. It implements the well-known encoder-decoder architecture with attention.

If you are interested in collaborating or have any questions, please submit a pull request or issue. You can also send questions to sockeye-dev-at-amazon-dot-com.

Dependencies

Sockeye requires:

Install them with:

> pip install -r requirements.txt

Optionally, dmlc's tensorboard fork is supported to track learning curves (pip install tensorboard).

Full dependencies are listed in requirements.txt.

Installation

You have two options for installing sockeye: pip and directly from source.

pip

> pip install sockeye

From Source

If you want to just use sockeye without extending it, simply install it via

> python setup.py install

after cloning the repository from git. After installation, command line tools such as sockeye-train, sockeye-translate, sockeye-average and sockeye-embeddings are available. Alternatively, if the sockeye directory is on your PYTHONPATH you can run the modules directly. For example sockeye-train can also be invoked as

> python -m sockeye.train <args>

First Steps

Train

In order to train your first Neural Machine Translation model you will need two sets of parallel files: one for training and one for validation. The latter will be used for computing various metrics during training. Each set should consist of two files: one with source sentences and one with target sentences (translations). Both files should have the same number of lines, each line containing a single sentence. Each sentence should be a whitespace delimited list of tokens.

Say you wanted to train a German to English translation model, then you would call sockeye like this:

> python -m sockeye.train --source sentences.de \
                       --target sentences.en \
                       --validation-source sentences.dev.de \
                       --validation-target sentences.dev.en \
                       --use-cpu \
                       --output <model_dir>

After training the directory <model_dir> will contain all model artifacts such as parameters and model configuration.

Translate

Input data for translation should be in the same format as the training data (tokenization, preprocessing scheme). You can translate as follows:

> python -m sockeye.translate --models <model_dir> --use-cpu

This will take the best set of parameters found during training and then translate strings from STDIN and write translations to STDOUT.

For more detailed examples check out our user documentation.

sockeye's People

Contributors

fhieber avatar tdomhan 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.