Learning confidence transformation for handwritten Chinese text recognition