Latent Variable Perceptron Algorithm for Structured Classification