| def explain_score(lead_score, ai_score, confidence, risk, stage, gap, emails, meetings): | |
| return ( | |
| f"Lead score was based on the {stage} stage, deal timing (close in {gap} days), " | |
| f"and {emails} emails + {meetings} meetings.\n" | |
| f"The AI adjusted the score based on engagement intensity and urgency.\n" | |
| f"Confidence was computed from model certainty and outcome spread.\n" | |
| f"Risk was assigned due to {'low engagement' if risk == 'High' else 'healthy momentum'}." | |
| ) | |