expected = ["30", "5", "unknown"] predicted = ["30", "7", "unknown"] accuracy = sum(a == b for a, b in zip(expected, predicted))/3 truth = {"invoice_id", "total", "currency"} found = {"invoice_id", "total", "customer_age"} tp = len(truth & found) precision, recall = tp/len(found), tp/len(truth) print("Exact-match accuracy:", round(accuracy, 3)) print("Precision:", round(precision, 3)) print("Recall:", round(recall, 3))