Eng-Musa commited on
Commit
2b973d9
·
1 Parent(s): 42a8cb7

impove adder and punisher

Browse files
Files changed (1) hide show
  1. services/job_matcher.py +11 -1
services/job_matcher.py CHANGED
@@ -406,7 +406,17 @@ class JobMatcher:
406
  ) * 100
407
 
408
  # Category Distance Booster / Punisher
409
- cat_modifier = self._category_distance_modifier(cv_category, job.category)
 
 
 
 
 
 
 
 
 
 
410
  final = base_final + cat_modifier
411
 
412
  # Guardrails
 
406
  ) * 100
407
 
408
  # Category Distance Booster / Punisher
409
+ # Deduct up to -20 if category score is below 75%
410
+ # Award up to +10 if category score is >= 75%
411
+ if cat_score < 0.75:
412
+ # Map [0.30, 0.75] to [-20.0, 0.0]
413
+ cat_modifier = -20.0 + ((cat_score - 0.30) / 0.45) * 20.0
414
+ cat_modifier = max(-20.0, min(0.0, cat_modifier))
415
+ else:
416
+ # Map [0.75, 1.0] to [0.0, 10.0]
417
+ cat_modifier = ((cat_score - 0.75) / 0.25) * 10.0
418
+ cat_modifier = max(0.0, min(10.0, cat_modifier))
419
+
420
  final = base_final + cat_modifier
421
 
422
  # Guardrails