1. Accuracy with a breakdown
medium25 XPWrite score(dataset, predict) where each example is {"input", "expected", "tag"}. Grade with normalised exact match (case-insensitive, whitespace-trimmed, collapse internal whitespace). If predict raises, count it as a failure with error recorded. Return {"accuracy": float(4dp), "by_tag": {tag: float(4dp)}, "failures": [{"input", "expected", "got"}]} where got is the prediction or "error: <ExceptionType>".
Ctrl/⌘ + Enter runs the tests · Esc then Tab leaves the editor