A Unified View of Evaluation Metrics for Structured Prediction