5226e0bcdcb42b2d2d8806134599b70a5249d8a1,tools/test_rouge.py,,test_rouge,#Any#Any#,8

Before Change


        os.mkdir(tmp_dir)
        os.mkdir(tmp_dir + "/candidate")
        os.mkdir(tmp_dir + "/reference")
    for i, line in enumerate(f_cand):
        with open(tmp_dir + "/candidate/cand.{}.txt".format(
                str(i).zfill(3)), "w", encoding="utf-8") as f:
            f.write(line)
    for i, line in enumerate(f_ref):
        with open(tmp_dir + "/reference/ref.{}.txt".format(
                str(i).zfill(3)), "w", encoding="utf-8") as f:
            f.write(line)

After Change


            os.mkdir(tmp_dir + "/candidate")
            os.mkdir(tmp_dir + "/reference")
        candidates = [line.strip() for line in f_cand]
        references = [line.strip() for line in f_ref]
        assert len(candidates) == len(references)
        cnt = len(candidates)
        for i in range(cnt):
            if len(references[i]) < 1:
                continue
            with open(tmp_dir + "/candidate/cand.{}.txt".format(i), "w",
                      encoding="utf-8") as f:
                f.write(candidates[i])
            with open(tmp_dir + "/reference/ref.{}.txt".format(i), "w",
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 5226e0bcdcb42b2d2d8806134599b70a5249d8a1
Time: 2017-12-29
Author: myscarlet@sina.com
File Name: tools/test_rouge.py
Class Name:
Method Name: test_rouge


Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 80373cedf76f85b47de78080712f508a46c5345c
Time: 2018-05-16
Author: okuchaiev@nvidia.com
File Name: open_seq2seq/models/text2text_test.py
Class Name: BasicText2TextWithAttentionTest
Method Name: test_train


Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 80373cedf76f85b47de78080712f508a46c5345c
Time: 2018-05-16
Author: okuchaiev@nvidia.com
File Name: open_seq2seq/models/text2text_test.py
Class Name: BasicText2TextWithAttentionTestOnHorovod
Method Name: test_train