Skip to content

Conversation

@PranuPranjal
Copy link

@PranuPranjal PranuPranjal commented Oct 17, 2025

✨ Add Optional Role Fit Scoring to Hiring Pipeline

📝 Overview

This update introduces an optional Role Fit scoring system (0–20) that evaluates how closely a candidate’s profile aligns with a given role description. When a role file is provided, the system computes the score, displays evidence in the console, and exports results to CSV.


🎯 Motivation

Recruiters often need to assess role-specific suitability beyond generic resume quality.
This feature enables transparent, evidence-backed comparisons between candidates for a particular job description.


🔧 Changes Included

  • models.py → Added role_fit: CategoryScore to Scores.
  • prompts/templates/role_fit.jinja → New template defining a 0–20 rubric and JSON schema.
  • prompts/template_manager.py → Loads role_fit.jinja.
  • evaluator.py
    • ResumeEvaluator now accepts a role_description.
    • Performs structured LLM evaluation for Role Fit and attaches result to scores.role_fit.
  • score.py
    • CLI now supports an optional role file:
      python score.py <resume.pdf> <role.txt>
    • Prints “Role Fit” category in console and ignores None categories in aggregation.
  • transform.py → Exports role_fit_score and role_fit_max to resume_evaluations.csv.
  • README.md → Updated with Role Fit usage instructions.

⚙️ How It Works

  1. If a role description is provided, evaluator.py renders role_fit.jinja with the resume + GitHub/blog context and the role description.
  2. The model returns structured JSON:
    {
      "score": <int>,
      "max": 20,
      "evidence": "<string>"
    }
  3. The result is appended to evaluation.scores.role_fit.

Example CLI usage:

# Existing
python score.py /path/to/resume.pdf

With Role Fit

python score.py /path/to/resume.pdf /path/to/role.txt

Output:

  • Console: Adds a “Role Fit” category with score and evidence.
  • CSV: Includes role_fit_score and role_fit_max columns.

🔄 Backward Compatibility

  • Fully backward compatible.
  • If no role description is provided, Role Fit evaluation is skipped and existing behavior remains unchanged.

🧪 Testing

  • Verified end-to-end with and without role file.
  • No regressions in existing scoring categories.
  • Role Fit appears only when applicable.
  • CSV correctly includes new columns.

Closes #158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

feat: Added role fit scoring

1 participant