Repository navigation
Tags
Tags
No longer relying on external translation id. (#508) * No longer relying on external translation id. * Making mypy happy. * removing chunk_id from input tests. * fix branch without source eos * update docstring * Sentence ids can now be strings * addressed comment
Refactor beam search to use gluon hybrid blocks (#425) This refactors beam search to group fixed-size operations in beam search into cached ops through Gluon HybridBlocks. My testing showed ~3% speed improvement. Not much, but consistent. Another change that is included here is to not use columns from `sequences` to pass into the decoder step module, but use `best_word_indices` from the previous iteration. NDArray indexing seems expensive and ideally we should aim for avoiding all indexing ops in an iteration.
Update to MXNet 1.2 (#388) This PR updates Sockeye to MXNet 1.2 which was released May 21st 2018. Core change to Sockeye is the use of the new LayerNormalization operator which reduces GPU memory usage. It uses the same set of parameters existing models are compatible, but running sockeye now requires mxnet 1.2.
Added hard lexical constraints (Post & Vilar, NAACL 2018) (#349)
* Added hard lexical constraints (Post & Vilar, NAACL 2018)
This commit adds hard lexical constraints as described in Post & Vilar,
Fast Lexically Constrained Decoding with Dynamic Beam Allocation for Neural Machine Translation (NAACL 2018).
Hard lexical constraints are words or phrases that must appear in the translation output.
To use this feature, for a particular input sentences, create a (1-line) JSON object of the following form:
```
{ "text": "Einer soll ein hoch@@ rangi@@ ges Mitglied aus Berlin gewesen sein .",
"constraints": ["is said to", "powerful"] }
```
You then need to pass the JSON input flag (`--json-input`) to `sockeye.translate`.
PreviousNext