Structured prediction for sequential data