Skip to content

Commit

Permalink
Ratio should be predlen/reflen not reflen/predlen
Browse files Browse the repository at this point in the history
To be compatible with multi-bleu.
This seems to only affect the result_string.
  • Loading branch information
Joost Bastings authored Jan 29, 2018
1 parent ee36a6f commit 1ff3efc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairseq/bleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,5 @@ def result_string(self, order=4):
fmt += ' (BP={:.3f}, ratio={:.3f}, syslen={}, reflen={})'
bleup = [p * 100 for p in self.precision()[:order]]
return fmt.format(order, self.score(order=order), *bleup,
self.brevity(), self.stat.reflen/self.stat.predlen,
self.brevity(), self.stat.predlen/self.stat.reflen,
self.stat.predlen, self.stat.reflen)

0 comments on commit 1ff3efc

Please sign in to comment.