Implementation of Collin's perceptron for structured prediction