It is a slightly modified version of Goldberg and Nivre (2013)'s algorithm 3, an approach they called learning with exploration.
as our neural network uses a crossentropy loss, and not the perceptron loss used in , updates are performed even when the prediction is correct.