This commit is contained in:
Ryan Shpeherd
2026-08-10 15:51:25 -04:00
parent 612fdd5789
commit ac8fc5ed7c
5 changed files with 349 additions and 18 deletions
+26
View File
@@ -0,0 +1,26 @@
"""Threshold-based routing of video-level confidence to MATCH / REVIEW / SKIP."""
import logging
logger = logging.getLogger(__name__)
MATCH = "MATCH"
REVIEW = "REVIEW"
SKIP = "SKIP"
def route(
confidence: float,
t_high: float = 0.75,
t_low: float = 0.45,
) -> str:
"""Return the routing decision for a video-level confidence score."""
if confidence >= t_high:
decision = MATCH
elif confidence >= t_low:
decision = REVIEW
else:
decision = SKIP
logger.debug("route: C=%.4f t_high=%.2f t_low=%.2f → %s", confidence, t_high, t_low, decision)
return decision