Resource Constrained Structured Prediction