"git@developer.sourcefind.cn:OpenDAS/ktransformers.git" did not exist on "021822dd01b0ade6690ad358a46a4829de55ec84"
Commit 58b912f6 authored by Xian Li's avatar Xian Li Committed by Facebook Github Bot
Browse files

Fix sacrebleu (#630)

Summary:
Pull Request resolved: https://github.com/pytorch/fairseq/pull/630

sacrebleu scorer has stopped working in pytorch_translate (maybe
fairseq too) probably due to  a recent api change.

Reviewed By: jmp84

Differential Revision: D14792797

fbshipit-source-id: c2a00246e08bc913c41e60c5fbf8ab4ab5e80d18
parent e5ba94ab
...@@ -52,7 +52,7 @@ class SacrebleuScorer(object): ...@@ -52,7 +52,7 @@ class SacrebleuScorer(object):
self.sys.append(pred) self.sys.append(pred)
def score(self, order=4): def score(self, order=4):
return self.result_string(order).bleu return self.result_string(order).score
def result_string(self, order=4): def result_string(self, order=4):
if order != 4: if order != 4:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment