A Consistent Regularization Approach for Structured Prediction