Data entry and PDF extraction · demo project, fictional source
Scanned pages typed into Word and Excel, with the accuracy measured
Five scanned pages (two typed, two handwritten, one stock table) were typed into Word, plain text and Excel. Every figure below was counted against a ground-truth copy. Words the OCR engine was unsure about were flagged, and I checked each flagged word against a crop of the page.
- Sample-Transcription.docx (the typed result, unclear words highlighted and commented)
- Stock-Count-Page5.xlsx (the table as a working sheet)
- accuracy-report.md (every error and every flagged word)
The problem
Scans are slow to retype and easy to mistype: a swapped digit in a price or a date is hard to spot later. Clients ask how many mistakes to expect, and a promise is not a number.
What I did
- Straightened each page, read it with an offline OCR engine, and rebuilt the lines, blank lines and table columns.
- Flagged the words the engine was unsure about, unknown words, digit/letter mixes and smudged words (4 of 5 smudged words were caught; see Known limits), and kept a cropped picture of each flag.
- I reviewed each flagged crop and confirmed the word, corrected it or marked it unclear; for unclear words the best reading was kept and the word was highlighted with a Word comment.
- Built the Word file (one paragraph per source line, the table as a Word table), a plain text file, and an Excel sheet where Qty x Unit price is a formula checked against the printed line total.
Standards met
| Stage | Characters correct | Words correct | Fields correct |
|---|---|---|---|
| Plain OCR text | 97.51% | 80.52% | not scored |
| After the machine clean-up | 99.35% | 94.61% | 110 of 119 (92.44%) |
| Delivered, after my review of 71 flagged words | 99.90% | 99.48% | 118 of 119 (99.16%) |
A script compares each stage with the ground truth (3098 characters, 575 words). Fields are 74 table cells on page 5 plus 45 amount, date, time and count tokens on pages 1-4. Measured on 25 November 2026, scope: this 5-page fictional sample.
How it was tested
- 119 fields compared one by one; 118 matched after review, 1 did not (page 5 line 11: expected “Paint brush 50 mm”, delivered “Paintbrush 50 mm”). Separately, 2 lines still differ in the text after review: page 3 line 9: expected “- raise the bed by 15 cm”, delivered “raise the bed by 15 cm”; page 5 line 11: expected “QH-3008 | Paint brush 50 mm | 22 | ea | 3.95 | 86.90”, delivered “QH-3008 | Paintbrush 50 mm | 22 | ea | 3.95 | 86.90” (the field miss above).
- Digits and dates: 45 of 45 amounts, dates, times and counts on pages 1-4 were right after review; on page 5, 12 of 12 SKU codes and 12 of 12 line totals match the scan.
- 13 lines were wrong in the machine pass; 13 of them carried at least one flag, 0 carried none (a flagged line can still hold an error the flag does not point at; see Known limits).
- 4 of 5 smudged words in the source were flagged and delivered as unclear with a comment.
- Table: the 74 cells (grand total included) were read from the scan by the machine pass, not retyped; the Excel sheet recomputes each line and the total.
- The accuracy script's numbers were recomputed by a separate test with its own edit-distance code (53 tests, 0 failed).
Screens



Downloads
- Sample-Transcription.docx (Word, with highlights and comments on the unclear words)
- Sample-Transcription.txt (plain text, UTF-8)
- Stock-Count-Page5.xlsx (Excel, formulas and data validation)
- scanned-source.pdf (the fictional 5-page scan that was typed)
- accuracy-report.md (full error list, flags and method)
- flags.csv (every flagged word with the decision)
Known limits
- Small sample: 575 words on 5 pages. The percentages describe this sample, not every scan; worse scans give more flags.
- I did the review and had also read the ground truth while fixing the machine pass, so the delivered figure is not a blind, independent review.
- 4 of 5 smudged words were flagged; the one missed is “trellis” (page 2 line 5). Page 3 line 9 lost its leading “- ” bullet in the machine pass and no flag marks that loss.
- Bold and underline were detected automatically and were not part of the review (18 of 33 bold words and 8 of 9 underlined words found).
- Not yet checked: opening the Word and Excel files in Microsoft Office or LibreOffice.
Last checked: 25 November 2026.
Built with: RapidOCR (rapidocr_onnxruntime 1.4.4), PyMuPDF 1.28.2, python-docx 1.2.0, openpyxl 3.1.5, Python 3.11