Beispiel #1
0
 def test_bleu_different(self):
   ref = self._create_temp_file("Testing\nmore tests!")
   hyp = self._create_temp_file("Dog\nCat")
   uncased_score = bleu.bleu_wrapper(ref, hyp, False)
   cased_score = bleu.bleu_wrapper(ref, hyp, True)
   self.assertLess(uncased_score, 100)
   self.assertLess(cased_score, 100)
Beispiel #2
0
 def test_bleu_same_different_case(self):
   ref = self._create_temp_file("Test 1 two 3\nmore tests!")
   hyp = self._create_temp_file("test 1 two 3\nMore tests!")
   uncased_score = bleu.bleu_wrapper(ref, hyp, False)
   cased_score = bleu.bleu_wrapper(ref, hyp, True)
   self.assertEqual(100, uncased_score)
   self.assertLess(cased_score, 100)