Skip to main content

Sequence-to-Sequence framework for Neural Machine Translation

Project description

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: - Python3 - MXNet-0.10.0 - numpy

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

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 ** 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.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sockeye-1.0.1.tar.gz (65.7 kB view details)

Uploaded Source

File details

Details for the file sockeye-1.0.1.tar.gz.

File metadata

  • Download URL: sockeye-1.0.1.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sockeye-1.0.1.tar.gz
Algorithm Hash digest
SHA256 deca74705206d85bbaf7fbd0764f31e6f91ffc2672e4491a2ae7ffe759780b76
MD5 898e454572a685c8e15d4d3cd93c2625
BLAKE2b-256 0cc63825348c249ee02d20b243a248f148818a0bd56afb52eedd17593fdb56c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page