Skip to content

Commit bf656df

Browse files
committed
Fix HITL Confidence alerts for Pattern1
1 parent 6b4bf16 commit bf656df

File tree

1 file changed

+8
-5
lines changed
  • patterns/pattern-1/src/processresults_function

1 file changed

+8
-5
lines changed

patterns/pattern-1/src/processresults_function/index.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -871,12 +871,15 @@ def process_segments(
871871
bp_confidence = custom_output["matched_blueprint"]["confidence"]
872872

873873
# Check if any key-value or blueprint confidence is below threshold
874-
low_confidence = (any(
875-
kv['confidence'] < confidence_threshold
876-
for page_num in page_indices
877-
for kv in pagespecific_details['key_value_details'].get(str(page_num), [])
878-
) or float(bp_confidence) < confidence_threshold) and enable_hitl=='true'
874+
if enable_hitl:
879875

876+
low_confidence = any(
877+
kv['confidence'] < confidence_threshold
878+
for page_num in page_indices
879+
for kv in pagespecific_details['key_value_details'].get(str(page_num), [])
880+
) or float(bp_confidence) < confidence_threshold
881+
else:
882+
low_confidence = 'false'
880883
logger.info(f"HITL STatus Low confidence {low_confidence}")
881884

882885
item.update({

0 commit comments

Comments
 (0)