2625325425475b1c3b0867e469e6cfe73cadd1cd,tests/test_eval_model.py,TestEvalModel,test_metrics_all,#TestEvalModel#,70

Before Change


        self.assertGreater(len(str_output), 0, "Output is empty")

        // decode the output
        scores = str_output.split("\n---\n")

        for i in range(1, len(scores)):
            score = ast.literal_eval(scores[i])
            // check totals
            self.assertEqual(score["exs"], i, "Total is incorrect")
            // accuracy should be one
            self.assertEqual("accuracy" in score, True, "Accuracy is missing from all")
            self.assertEqual(score["accuracy"], 1, "Accuracy != 1")
            self.assertEqual("rouge-1" in score, True, "Rouge is missing from all")
            self.assertEqual(score["rouge-1"], 1, "rouge1 != 1")
            self.assertEqual(score["rouge-2"], 1, "rouge-2 != 1")
            self.assertEqual(score["rouge-L"], 1, "rouge-L != 1")

    def test_metrics_select(self):
        
        Test output of running eval_model.
        

After Change



        self.assertEqual(valid["accuracy"], 1)
        self.assertEqual(valid["rouge-L"], 1)
        self.assertEqual(valid["rouge-1"], 1)
        self.assertEqual(valid["rouge-2"], 1)
        self.assertEqual(test["accuracy"], 1)
        self.assertEqual(test["rouge-L"], 1)
        self.assertEqual(test["rouge-1"], 1)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 15

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 2625325425475b1c3b0867e469e6cfe73cadd1cd
Time: 2020-01-16
Author: roller@fb.com
File Name: tests/test_eval_model.py
Class Name: TestEvalModel
Method Name: test_metrics_all


Project Name: facebookresearch/ParlAI
Commit Name: 2625325425475b1c3b0867e469e6cfe73cadd1cd
Time: 2020-01-16
Author: roller@fb.com
File Name: tests/test_eval_model.py
Class Name: TestEvalModel
Method Name: test_metrics_select


Project Name: facebookresearch/ParlAI
Commit Name: 2625325425475b1c3b0867e469e6cfe73cadd1cd
Time: 2020-01-16
Author: roller@fb.com
File Name: tests/test_eval_model.py
Class Name: TestEvalModel
Method Name: test_metrics_all


Project Name: facebookresearch/ParlAI
Commit Name: 2625325425475b1c3b0867e469e6cfe73cadd1cd
Time: 2020-01-16
Author: roller@fb.com
File Name: tests/test_eval_model.py
Class Name: TestEvalModel
Method Name: test_output