Piecewise pseudolikelihood for efficient training of conditional random fields