Reputation: 594
Currently there are unpredicted extra spaces as the two samples below (OCR result); And Google did not complete fix it at this time;
Therefore, we're looking for post processing (Do String Manipulation from OCR result to Expected result).
However, from my experience, I don't see logic to cover all of the unpredicted extra spaces.
Could you help to suggest and correct me, please? Thank you very much.
Sample 1:
OCR result: NATURAL VITAMIN E 400 MEGA CAPSULE 400 IU รับ ประทาน ครั้ง ละ 1 เม็ด วัน ละ 1 ครั้ง หลัง อาหาร เช้า ยา นี้ หมด อายุ ภายใน 1 ปี นับ จาก วัน ที่ ได้ รับ
Expected result (If see by human eyes): NATURAL VITAMIN E 400 MEGA CAPSULE 400 IU รับประทาน ครั้งละ 1 เม็ด วันละ 1 ครั้ง หลังอาหารเช้า ยานี้หมดอายุภายใน 1 ปีนับจากวันที่ได้รับ
Sample 2:
OCR result: MOLAX - M TABLET 10 MG รับ ประทาน ครั้ง ละ 1 เม็ด วัน ละ 3 ครั้ง ก่อน อาหาร เช้า กลาง วัน เย็น ยา แก้ คลื่นไส้ อาเจียน ปรับ การ บีบ ตัว ของ ทาง เดิน อาหาร ควร รับ ประทาน ยา นี้ ก่อน อาหาร ครึ่ง ชั่วโมง
Expected result (If see by human eyes): MOLAX - M TABLET 10 MG รับประทาน ครั้งละ 1 เม็ด วันละ 3 ครั้ง ก่อนอาหารเช้า กลางวัน เย็น ยาแก้คลื่นไส้อาเจียน ปรับการบีบตัวของทางเดินอาหาร ควรรับประทานยานี้ก่อนอาหารครึ่งชั่วโมง
Upvotes: 0
Views: 80
Reputation: 363
As @Fildor mentioned in the comment when he did OCR (Invoices) we used to have a multilayered process. If OCR confidence was above a certtain threshold, it went through, directly (very high confidence). If it was less, then it would be validated against several measures depending on the content. For example City names against a Database of all the city names in existence in the respective country. Then we would have a list of say the top 5 most probable hits. If the top hit was still below a certain resemblance indicator, then it would be run by a human to validate / correct it. And the result would be fed back into the AI part of the recognition as additional training data. That way the process is not 100% automatic but we were able to go from 100% human data entry to about 1% Human Data validation and 0.1% Human data correction. With improving numbers in the warmup phase and keeping the training set optimized prevented deteriorating AI performance.
Also mentioned by @Tlaquetzal in the stack link At the moment, it is not possible to do this. I found a Feature Request made to Cloud Vision API to take a PDF file and export it as a searchable PDF which might resolve this issue. I recommend you to subscribe to the Feature Request (click on the star next to the title) so it can get more visibility.
Posting the answer as community wiki for the benefit of the community that might encounter this use case in the future.
Feel free to edit this answer for additional information.
Upvotes: 1