Implementation of linear chain conditional random fields