def test_multeval_meteor(self): if os.path.exists(MULTEVAL): multeval = MultEvalWrapper(MULTEVAL, metric="meteor") meteor = multeval([HYP], [REF]) max_meteor = multeval([REF], [REF]) min_meteor = multeval([[]], [REF]) self.assertEqual(max_meteor, 1.0) self.assertAlmostEqual(min_meteor, 0.0) self.assertAlmostEqual(meteor, 0.093) else: print("MultEval not installed, cannot be found here: {}". format(MULTEVAL))
def test_multeval_bleu(self): if os.path.exists(MULTEVAL): multeval = MultEvalWrapper(MULTEVAL, metric="bleu") bleu = multeval([HYP], [REF]) max_bleu = multeval([REF], [REF], ) min_bleu = multeval([[]], [REF]) self.assertEqual(max_bleu, 1.0) self.assertEqual(min_bleu, 0.042) # smoothing self.assertAlmostEqual(bleu, 0.097) else: print("MultEval not installed, cannot be found here: {}". format(MULTEVAL))