Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support server for nbest translation #1631

Merged
merged 1 commit into from Nov 12, 2019

Conversation

@Zenglinxiao
Copy link
Contributor

Zenglinxiao commented Nov 7, 2019

Solve issus #1614. Support server output n_best translation.
With this PR, server will output translation as:

[
  [
    {
      "n_best": 2, 
      "pred_score": -0.15397775173187256, 
      "src": "text to translate 1.", 
      "tgt": "translation 1 - 1_best."
    }, 
    {
      "n_best": 2, 
      "pred_score": -0.2884165942668915, 
      "src": "text to translate 2.", 
      "tgt": "translation 2 - 1_best."
    }
  ],
  [
    {
      "n_best": 2, 
      "pred_score": -0.5973197817802429, 
      "src": "text to translate 1.", 
      "tgt": "translation 1 - 2_best."
    }, 
    {
      "n_best": 2, 
      "pred_score": -0.5908429622650146, 
      "src": "text to translate 2.", 
      "tgt": "translation 2 - 2_best."
    }
  ]
]
@francoishernandez francoishernandez merged commit 3e9c528 into OpenNMT:master Nov 12, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@francoishernandez

This comment has been minimized.

Copy link
Contributor

francoishernandez commented Nov 12, 2019

Thanks guys!
Note: this should not break existing implementations using this server, as the structure for n_best=1 stays the same.

@Zenglinxiao Zenglinxiao deleted the Zenglinxiao:nbest_server branch Nov 20, 2019
francoishernandez pushed a commit to KaijuML/OpenNMT-py that referenced this pull request Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.