Commit 726a47dc authored by ngimel's avatar ngimel Committed by Facebook Github Bot
Browse files

Fix "ignore-case" behavior (#339)

Summary:
Currently, if `ignore-case` is set, the same line will be yielded twice - once as lower-cased version, once as original version, leading to lower than expected uncased scores.
Pull Request resolved: https://github.com/pytorch/fairseq/pull/339

Differential Revision: D12890386

Pulled By: myleott

fbshipit-source-id: 0570e5f6e8f848f2c6439d615e70aca6df097eef
parent 50a671f7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ def main():
        for line in fd.readlines():
            if args.ignore_case:
                yield line.lower()
            else:     
                yield line

    def score(fdsys):