私信发送成功
检测到您已登录技术前沿网,是否 一键登录码云 ?
Watch 4 Star 8

码云极速下载 / sockeyeApache-2.0

此项目是为了提升国内下载速度的镜像仓库,每日同步一次,原项目仓库地址为 https://github.com/awslabs/sockeye/releases。
Sockeye 是一个基于 Apache MXNet 的快速而可扩展的深度学习库
123 Commits
32 Branches
1 Tags
0 Releases
Fetching Contributors
克隆/下载
挂件
Michael Denkowski 最后提交于 2017-09-27 22:44 . Word batching update (152)
docs
Felix Hieber Transformer models in Sockeye (98)
2017-08-14 17:35
sockeye
Michael Denkowski Word batching update (152)
2017-09-27 22:44
test
Michael Denkowski Word batching update (152)
2017-09-27 22:44
tutorials
Tobias Domhan Sequence copy and WMT tutorial (120)
2017-08-30 18:07
.gitignore
David Vilar Do not use assertions for checking user input (52)
2017-07-06 16:08
.travis.yml
Tobias Domhan Python 3.4 support. (97)
2017-08-02 20:31
CODEOWNERS
Felix Hieber Added CODEOWNERS file (150)
2017-09-21 21:53
CONTRIBUTING.md
Felix Hieber Added CODEOWNERS file (150)
2017-09-21 21:53
LICENSE
Felix Hieber Initial commit
2017-06-08 15:44
MANIFEST.in
Felix Hieber Added CODEOWNERS file (150)
2017-09-21 21:53
NOTICE
Felix Hieber Initial commit
2017-06-08 15:44
README.md
Tobias Domhan Tutorial URL fix. (125)
2017-08-30 20:10
pre-commit.sh
Michael Denkowski End-to-end testing with various model configurations (85)
2017-07-26 22:25
pylintrc
Michael Denkowski sockeye.pylintrc -> pylintrc
2017-07-23 05:41
pytest.ini
Michael Denkowski End-to-end testing with various model configurations (85)
2017-07-26 22:25
requirements.dev.txt
Tobias Domhan Split requirements into dev/docs, correct MANIFEST + automatic MANIFES…
2017-06-21 20:23
requirements.docs.txt
Tobias Domhan Split requirements into dev/docs, correct MANIFEST + automatic MANIFES…
2017-06-21 20:23
requirements.gpu-cu75.txt
Tobias Domhan Adding the pyyaml dependency to our GPU requirements files. (105)
2017-08-11 16:11
requirements.gpu-cu80.txt
Tobias Domhan Adding the pyyaml dependency to our GPU requirements files. (105)
2017-08-11 16:11
requirements.txt
Felix Hieber Config (72)
2017-07-18 00:08
setup.cfg
Tobias Domhan PyPI compatibility and updated instructions. (3)
2017-06-13 01:43
setup.py
Felix Hieber Added CLI to build vocabulary (149)
2017-09-21 22:17
typechecked-files
Felix Hieber Added most files to typechecked-files (151)
2017-09-21 22:59
Loading...
README.md 4.95 KB

Sockeye

Documentation Status Build Status

This package contains the Sockeye project, a sequence-to-sequence framework for Neural Machine Translation based on Apache MXNet Incubating. 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

Installation

There are several options for installing Sockeye and it's dependencies. Below we list several alternatives and the corresponding instructions.

Either: AWS DeepLearning AMI

AWS DeepLearning AMI users only need to run the following line to install sockeye:

> sudo pip3 install sockeye --no-deps

For other environments, you can choose between installing via pip or directly from source. Note that for the remaining instructions to work you will need to use python3 instead of python and pip3 instead of pip.

Or: pip package

CPU

> pip install sockeye

GPU

If you want to run sockeye on a GPU you need to make sure your version of Apache MXNet Incubating contains the GPU bindings. Depending on your version of CUDA you can do this by running the following for CUDA 8.0:

> wget https://raw.githubusercontent.com/awslabs/sockeye/master/requirements.gpu-cu80.txt
> pip install sockeye --no-deps -r requirements.gpu-cu80.txt
> rm requirements.gpu-cu80.txt

or the following for CUDA 7.5:

> wget https://raw.githubusercontent.com/awslabs/sockeye/master/requirements.gpu-cu75.txt
> pip install sockeye --no-deps -r requirements.gpu-cu75.txt
> rm requirements.gpu-cu75.txt

Or: From Source

CPU

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

> python setup.py install

after cloning the repository from git.

GPU

If you want to run sockeye on a GPU you need to make sure your version of Apache MXNet Incubating contains the GPU bindings. Depending on your version of CUDA you can do this by running the following for CUDA 8.0:

> python setup.py install -r requirements.gpu-cu80.txt

or the following for CUDA 7.5:

> python setup.py install -r requirements.gpu-cu75.txt

Optional dependencies

In order to track learning curves during training you can optionally install dmlc's tensorboard fork (pip install tensorboard). If you want to create alignment plots you will need to install matplotlib (pip install matplotlib).

In general you can install all optional dependencies from the Sockeye source folder using:

> pip install -e '.[optional]'

Running sockeye

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.

Step-by-step tutorial

More detailed step-by-step tutorials can be found in the tutorials directory.

项目点评 (0)

你可以在登录后,对此项目发表评论

Float_left Icon_close