Skip to content

Commit 00a558b

Browse files
author
Bob Strahan
committed
feat(ui): round OCR confidence values to 1 decimal point for cleaner display
1 parent 2b48f8e commit 00a558b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ SPDX-License-Identifier: MIT-0
1313
- Fixed issues with view persistence - Text Confidence View button now always visible with appropriate messaging when content unavailable
1414
- Fixed view toggle behavior - switching between views no longer closes the viewer window
1515
- Reordered view buttons to: Markdown View, Text Confidence View, Text View for better user experience
16+
- OCR confidence values now rounded to 1 decimal point (e.g., 99.1, 87.3) for cleaner display
1617

1718

1819
### Fixed

lib/idp_common_pkg/idp_common/ocr/service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ def _generate_text_confidence_data(
809809
810810
This method transforms verbose Textract output into a minimal format containing:
811811
- Essential text content (LINE blocks only)
812-
- OCR confidence scores
812+
- OCR confidence scores (rounded to 1 decimal point)
813813
- Text type (PRINTED/HANDWRITING)
814814
- Page count
815815
@@ -833,7 +833,7 @@ def _generate_text_confidence_data(
833833
if block.get("BlockType") == "LINE" and block.get("Text"):
834834
text_block = {
835835
"text": block.get("Text", ""),
836-
"confidence": block.get("Confidence"),
836+
"confidence": round(block.get("Confidence", 0.0), 1),
837837
}
838838

839839
# Include text type if available (PRINTED vs HANDWRITING)

0 commit comments

Comments
 (0)