def test_evaluate(self): """Test that comparing an SDP graph against itself returns perfect F1""" for _, ref, sdp_id in read_test_sdp(): scores = evaluate(ref, ref) self.assertAlmostEqual(scores.average_f1(), 1)
def evaluate_sdp(*args, **kwargs): from semstr.evaluation import sdp return sdp.evaluate(*args, **kwargs)
def convert_and_evaluate(self, passage, ref): converted = to_sdp(passage) scores = evaluate(converted, ref) self.assertAlmostEqual(scores.average_f1(), 1, msg="\n" + "\n".join(converted))