-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdecision_engine.py
More file actions
31 lines (23 loc) · 785 Bytes
/
Copy pathdecision_engine.py
File metadata and controls
31 lines (23 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# decision_engine.py
def decide(final_score: float) -> str:
if final_score >= 75:
return "STRONG_SHORTLIST"
elif final_score >= 60:
return "SHORTLIST"
elif final_score >= 45:
return "BORDERLINE"
else:
return "REJECT"
def explain(result: dict) -> str:
reasons = []
if result["skill_match_percent"] < 50:
reasons.append("Low skill match")
if result["semantic_score"] < 0.4:
reasons.append("Weak contextual relevance")
if result["experience_score"] == 0:
reasons.append("Insufficient experience")
if result["risk_score"] >= 3:
reasons.append("Resume risk flags detected")
if not reasons:
return "Profile aligns well with job requirements"
return ", ".join(reasons)