def confidence_score(intent, sentiment): score = 70 if sentiment == "NEGATIVE": score -= 20 if intent in ["Support", "Complaint"]: score += 10 return max(0, min(100, score))