INNER CODE UNIT · Python

rank_candidates

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

def rank_candidates(
    jd_text: str,
    candidates: list[dict[str, Any]],
    today: date | None = None,
    taste_text: str | None = None,
) -> list[dict[str, Any]]:
    scored = [
        score_candidate(candidate, jd_text, today=today, taste_text=taste_text)
        for candidate in candidates
    ]
    return sorted(
        scored,
        key=lambda item: (-safe_float(item.get("score")), str(item.get("name", "")).lower()),
    )


def _format_score(value: Any) -> str:
    return f"{safe_float(value):.2f}"

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…