Change the calculation of the histogram, add word_type and ocr_file