Example #1
0
 def testBLEUScorer(self):
     if sys.version_info >= (3, 0):
         bleu_scorer = scorers.BLEUScorer()
         ref_path, hyp_path = self._make_perfect_hypothesis_file()
         score = bleu_scorer(ref_path, hyp_path)
         self.assertEqual(100, int(score))
     else:
         with self.assertRaises(ImportError):
             bleu_scorer = scorers.BLEUScorer()
Example #2
0
 def testBLEUScorer(self):
     refs = ["Hello world !", "How is it going ?"]
     scorer = scorers.BLEUScorer()
     score = self._run_scorer(scorer, refs, refs)
     self.assertEqual(100, int(score))
Example #3
0
 def testBLEUScorer(self):
     bleu_scorer = scorers.BLEUScorer()
     ref_path, hyp_path = self._make_perfect_hypothesis_file()
     score = bleu_scorer(ref_path, hyp_path)
     self.assertEqual(100, int(score))