Direct Loss Minimization for Structured Prediction