INNER CODE UNIT · Python

normalize_score

LiuMengxuan04/shushu-internship-tool · skills/shushu-internship-tool/scripts/shushu_internship_tool/candidate_score.py:265

def normalize_score(raw_score: float, max_raw_score: float) -> float:
    if max_raw_score <= 0:
        return 0.0
    x = max(0.0, min(float(raw_score), float(max_raw_score)))
    return round(x * 100 / float(max_raw_score), 2)


def score_candidate(
    candidate: dict[str, Any],
    jd_text: str,
    today: date | None = None,
    taste_text: str | None = None,
) -> dict[str, Any]:
    today = today or date.today()
    prefer_tags, avoid_tags = parse_user_taste(taste_text)
    effective_taste = bool(prefer_tags or avoid_tags)
    max_raw_score = TASTE_MAX_RAW_SCORE if prefer_tags else NO_TASTE_MAX_RAW_SCORE

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…