Story 5
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user