示例#1
0
 def test_evaluate(self):
     """Test that comparing an AMR against itself returns perfect Smatch F1"""
     for _, ref, amr_id in read_test_amr():
         scores = evaluate(ref, ref, amr_id=amr_id)
         self.assertAlmostEqual(scores.average_f1(), 1)
示例#2
0
def evaluate_amr(*args, **kwargs):
    from semstr.evaluation import amr
    return amr.evaluate(*args, **kwargs)
示例#3
0
 def convert_and_evaluate(self, amr_id, passage, ref):
     converted = "\n".join(to_amr(passage, metadata=False))
     scores = evaluate(converted, ref, amr_id=amr_id)
     self.assertAlmostEqual(scores.average_f1(), 1, msg=converted)