Spaces:
Running
Running
remove logs
Browse files
__pycache__/main.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/main.cpython-312.pyc and b/__pycache__/main.cpython-312.pyc differ
|
|
|
services/__pycache__/job_matcher.cpython-312.pyc
CHANGED
|
Binary files a/services/__pycache__/job_matcher.cpython-312.pyc and b/services/__pycache__/job_matcher.cpython-312.pyc differ
|
|
|
services/job_matcher.py
CHANGED
|
@@ -501,10 +501,8 @@ class JobMatcher:
|
|
| 501 |
|
| 502 |
all_missing_skills: Set[str] = set()
|
| 503 |
for job in job_objs:
|
| 504 |
-
job_technical = {
|
| 505 |
-
|
| 506 |
-
}
|
| 507 |
-
job_soft = {s.strip().lower() for s in job.skills_soft if s.strip()}
|
| 508 |
matched = sorted(cv_skills_technical_set & job_technical)
|
| 509 |
missing = sorted(job_technical - cv_skills_technical_set)
|
| 510 |
per_job_technical.append(job_technical)
|
|
@@ -646,9 +644,12 @@ class JobMatcher:
|
|
| 646 |
"""
|
| 647 |
Return a dict holding all CV-level data needed by _score_job.
|
| 648 |
"""
|
| 649 |
-
|
| 650 |
-
|
| 651 |
-
|
|
|
|
|
|
|
|
|
|
| 652 |
|
| 653 |
cv_vec = (
|
| 654 |
self._embed(cv_markdown[: self._CV_TEXT_MAX_CHARS])
|
|
@@ -743,12 +744,16 @@ class JobMatcher:
|
|
| 743 |
tech_denom = min(len(job_technical), 12) if job_technical else 1
|
| 744 |
soft_denom = min(len(job_soft), 3) if job_soft else 1
|
| 745 |
|
| 746 |
-
tech_score = (
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
| 750 |
-
|
| 751 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 752 |
|
| 753 |
# ββ Component scores βββββββββββββββββββββββββββββββββββββββββββββ
|
| 754 |
cv_cat_lower = cv_category.strip().lower() if cv_category else ""
|
|
@@ -790,14 +795,13 @@ class JobMatcher:
|
|
| 790 |
# Rebalanced: skill 42β35% (taxonomy-dependent, noisiest signal),
|
| 791 |
# semantic 23β30% (more robust, captures fit beyond exact skill labels),
|
| 792 |
# seniority 7β9% (was under-weighted for its actual impact on fit).
|
| 793 |
-
|
| 794 |
-
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
) * 100
|
| 801 |
|
| 802 |
# Category modifier: penalize category mismatch, but earn positive bonus through skill fit
|
| 803 |
if cat_score < 0.75:
|
|
@@ -805,7 +809,7 @@ class JobMatcher:
|
|
| 805 |
cat_modifier = max(-20.0, min(0.0, cat_modifier))
|
| 806 |
else:
|
| 807 |
# Positive modifier is earned based on skill overlap (scales up to +6.0)
|
| 808 |
-
max_boost = 6.0 * skill
|
| 809 |
cat_modifier = ((cat_score - 0.75) / 0.25) * max_boost
|
| 810 |
cat_modifier = max(0.0, min(6.0, cat_modifier))
|
| 811 |
|
|
@@ -815,7 +819,7 @@ class JobMatcher:
|
|
| 815 |
|
| 816 |
if job_technical and not matched_technical:
|
| 817 |
final = min(final, 34.0)
|
| 818 |
-
if cv_cat_lower != job_cat_lower and skill < 0.30:
|
| 819 |
final = min(final, 42.0)
|
| 820 |
if (
|
| 821 |
job.seniority == "senior"
|
|
@@ -850,7 +854,7 @@ class JobMatcher:
|
|
| 850 |
cv_skills=sorted(cv_skills),
|
| 851 |
cv_years_experience=cv_years,
|
| 852 |
score_breakdown=ScoreBreakdown(
|
| 853 |
-
skill_score=round(skill * 100, 2),
|
| 854 |
semantic_score=round(semantic * 100, 2),
|
| 855 |
title_score=round(title * 100, 2),
|
| 856 |
category_score=round(cat_score * 100, 2),
|
|
|
|
| 501 |
|
| 502 |
all_missing_skills: Set[str] = set()
|
| 503 |
for job in job_objs:
|
| 504 |
+
job_technical = {re.sub(r"\s+", " ", s.strip().lower()) for s in job.skills_technical if s and s.strip()}
|
| 505 |
+
job_soft = {re.sub(r"\s+", " ", s.strip().lower()) for s in job.skills_soft if s and s.strip()}
|
|
|
|
|
|
|
| 506 |
matched = sorted(cv_skills_technical_set & job_technical)
|
| 507 |
missing = sorted(job_technical - cv_skills_technical_set)
|
| 508 |
per_job_technical.append(job_technical)
|
|
|
|
| 644 |
"""
|
| 645 |
Return a dict holding all CV-level data needed by _score_job.
|
| 646 |
"""
|
| 647 |
+
# CV extractors may preserve display casing while job metadata is
|
| 648 |
+
# lowercase; normalize before all exact set comparisons.
|
| 649 |
+
normalize_skill = lambda value: re.sub(r"\s+", " ", value.strip().lower())
|
| 650 |
+
cv_skills_set = {normalize_skill(s) for s in cv_skills_canonical if s and s.strip()}
|
| 651 |
+
cv_skills_technical_set = {normalize_skill(s) for s in cv_skills_technical if s and s.strip()}
|
| 652 |
+
cv_skills_soft_set = {normalize_skill(s) for s in cv_skills_soft if s and s.strip()}
|
| 653 |
|
| 654 |
cv_vec = (
|
| 655 |
self._embed(cv_markdown[: self._CV_TEXT_MAX_CHARS])
|
|
|
|
| 744 |
tech_denom = min(len(job_technical), 12) if job_technical else 1
|
| 745 |
soft_denom = min(len(job_soft), 3) if job_soft else 1
|
| 746 |
|
| 747 |
+
tech_score = min(1.0, len(matched_technical) / tech_denom) if job_technical else None
|
| 748 |
+
soft_score = min(1.0, len(matched_soft) / soft_denom) if job_soft else None
|
| 749 |
+
if tech_score is not None and soft_score is not None:
|
| 750 |
+
skill = min(1.0, tech_score * 0.80 + soft_score * 0.20)
|
| 751 |
+
elif tech_score is not None:
|
| 752 |
+
skill = tech_score
|
| 753 |
+
elif soft_score is not None:
|
| 754 |
+
skill = soft_score
|
| 755 |
+
else:
|
| 756 |
+
skill = None # no extracted requirements: exclude this component
|
| 757 |
|
| 758 |
# ββ Component scores βββββββββββββββββββββββββββββββββββββββββββββ
|
| 759 |
cv_cat_lower = cv_category.strip().lower() if cv_category else ""
|
|
|
|
| 795 |
# Rebalanced: skill 42β35% (taxonomy-dependent, noisiest signal),
|
| 796 |
# semantic 23β30% (more robust, captures fit beyond exact skill labels),
|
| 797 |
# seniority 7β9% (was under-weighted for its actual impact on fit).
|
| 798 |
+
score_parts = [(0.30, semantic), (0.12, title), (0.09, cat_score), (0.09, seniority)]
|
| 799 |
+
if skill is not None:
|
| 800 |
+
score_parts.append((0.35, skill))
|
| 801 |
+
if job.min_years_experience > 0:
|
| 802 |
+
score_parts.append((0.05, experience))
|
| 803 |
+
active_weight = sum(weight for weight, _ in score_parts)
|
| 804 |
+
base_final = sum(weight * value for weight, value in score_parts) / active_weight * 100
|
|
|
|
| 805 |
|
| 806 |
# Category modifier: penalize category mismatch, but earn positive bonus through skill fit
|
| 807 |
if cat_score < 0.75:
|
|
|
|
| 809 |
cat_modifier = max(-20.0, min(0.0, cat_modifier))
|
| 810 |
else:
|
| 811 |
# Positive modifier is earned based on skill overlap (scales up to +6.0)
|
| 812 |
+
max_boost = 6.0 * (skill if skill is not None else 0.5)
|
| 813 |
cat_modifier = ((cat_score - 0.75) / 0.25) * max_boost
|
| 814 |
cat_modifier = max(0.0, min(6.0, cat_modifier))
|
| 815 |
|
|
|
|
| 819 |
|
| 820 |
if job_technical and not matched_technical:
|
| 821 |
final = min(final, 34.0)
|
| 822 |
+
if cv_cat_lower != job_cat_lower and skill is not None and skill < 0.30:
|
| 823 |
final = min(final, 42.0)
|
| 824 |
if (
|
| 825 |
job.seniority == "senior"
|
|
|
|
| 854 |
cv_skills=sorted(cv_skills),
|
| 855 |
cv_years_experience=cv_years,
|
| 856 |
score_breakdown=ScoreBreakdown(
|
| 857 |
+
skill_score=round(skill * 100, 2) if skill is not None else 0.0,
|
| 858 |
semantic_score=round(semantic * 100, 2),
|
| 859 |
title_score=round(title * 100, 2),
|
| 860 |
category_score=round(cat_score * 100, 2),
|