-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`.
- Loading branch information
Showing
14 changed files
with
968 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.