Check if this could help you https://github.com/yaqiz01/cs229-invoice-recognition/blob/e198cfc337003df1c1aa4aaa998f8082ce95dc51/bin/experiments#L477 126
Refererence: http://cs229.stanford.edu/proj2016/report/LiuWanZhang-UnstructuredDocumentRecognitionOnBusinessInvoice-report.pdf 44