Skip to content

0.4.2 — Better tables, rotated text and numeric fields

Choose a tag to compare

@Bodhi42 Bodhi42 released this 02 Oct 17:58
· 10 commits to main since this release

This release improves table structure recognition, adds line-level orientation correction, and protects numeric fields from unwanted language-model corrections.

  • Better table structure recognition. A new peak-based separator decoder improves row and column boundaries without retraining the model. In internal benchmarks, structure F1 increased from 90.5% to 92.0% overall, and from 76.2% to 79.5% on real Russian tables.

  • Line-level orientation correction, enabled by default with deskew=True. The detector now preserves text-region angles, allowing the recognizer to handle tilted lines, sideways text and vertically stacked characters. Confidence-based checks reduce false 180° rotations and improve handling of vertical numeric fields, including passport series and numbers. Whole-page orientation remains separately controlled by orientation=True.

  • Numeric-field protection during beam + LM decoding. The new code_lock mechanism preserves the recognizer’s greedy reading for digit-heavy sequences, reducing unwanted language-model changes to account numbers, tax IDs, document numbers and amounts. Regular text still benefits from language-model correction.

  • Improved confidence scores. Beam-decoding confidence now uses the selected hypothesis’s acoustic score, normalized by text length, providing a more useful signal for identifying uncertain recognition results.

  • Experimental UVDoc document unwarping. Added an optional module for flattening curved or warped document photos, with a self-contained PyTorch implementation and support for local or Hugging Face weights. Disabled by default; requires the [unwarp] extra. In 0.4.2, this is available through the low-level API.

Upgrade:

pip install -U occular-ocr==0.4.2