File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
lib/idp_common_pkg/idp_common/ocr Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments