ai-resume-screening-ranking-system

AI-Powered Resume Screening & Candidate Ranking System

An end-to-end Streamlit application that helps HR teams upload multiple candidate resumes, match them against a job description using TF-IDF / cosine similarity, score and rank candidates across five weighted categories, and chat with an AI HR assistant (Groq + Llama 3.1 8B Instant) about the results.

Screenshots

Main

Main

Resume Screening & Ranking

Screening

Screening

Rankings Dashboard

Ranking

Ranking

Candidate Profiles

Profiles

AI Chatbot

chatbot


Features


Project Structure

resume_screening/
├── app.py                   # Main Streamlit application (UI + page routing)
├── theme.py                 # Centralised CSS theme, header/footer helpers
├── resume_parser.py         # PDF text extraction & information parsing
├── ranking_engine.py        # Weighted scoring & ranking algorithms
├── vector_store.py          # Lightweight TF-IDF vector store
├── chatbot.py                # Groq API integration (HR assistant)
├── cv_generator.py           # Sample CV generator (10 candidate profiles)
├── sample_cvs/                # 10 pre-generated sample candidate PDFs
├── assets/                     # Favicon / logo assets
├── .streamlit/config.toml      # Streamlit theme & server config
├── requirements.txt
├── .env.example
└── README.md

Requirements


Setup (Windows / macOS / Linux)

  1. Clone or download this repository, then open it in VS Code.

  2. Create a virtual environment (recommended):

    python -m venv venv
    
    # Windows
    venv\Scripts\activate
    
    # macOS / Linux
    source venv/bin/activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Configure your Groq API key:

    cp .env.example .env      # Windows: copy .env.example .env
    

    Open .env and paste your key:

    GROQ_API_KEY=gsk_your_real_key_here
    

    You can also paste the key directly into the app’s “Groq API Key” field on the input page for a single session, without editing .env.

  5. Run the app:

    streamlit run app.py
    

    The app opens at http://localhost:8501.


Usage Guide

  1. Landing page - click Get Started.
  2. Input page:
    • Confirm/paste Groq API key (only required for the chatbot).
    • Either upload your own PDF resumes, or click Generate 2 Sample CVs / Load All 10 Sample Candidates to try the system instantly.
    • Paste a job description, or upload one as a PDF. A sensible default (“Senior AI/ML Engineer”) is pre-filled.
    • Click Process & Rank Candidates.
  3. Dashboard page:
    • Rankings tab - color-coded table, bar charts, and per-candidate strengths/weaknesses.
    • Candidate Profiles tab - full extracted profile for each candidate, with a per-category score chart.
    • AI Chatbot tab - ask questions like “Who is the best candidate for this role and why?” or use the quick-question buttons.

Scoring Methodology

Category Weight Method
Skills 35% Matched skills / required skills mentioned in the job description
Experience 30% Detected years of experience vs. years required in the JD
Education 15% Highest qualification detected (PhD > Masters > Bachelors > …)
Certifications 10% Number of certifications + relevance to the job description
Projects 10% TF-IDF cosine similarity between project text and job description

Overall Score = 0.35*Skills + 0.30*Experience + 0.15*Education + 0.10*Certifications + 0.10*Projects

Color bands: Green >= 80%, Yellow 60-79%, Red < 60%.


Notes on Sample Data

sample_cvs/ ships with 10 pre-generated candidate PDFs spanning AI/ML Engineer, Full Stack Developer, Data Scientist, DevOps Engineer, NLP Research Engineer, Backend/Frontend Developer, Cloud Architect, Computer Vision Engineer and a Junior Developer - deliberately varied so ranking against the default “Senior AI/ML Engineer” job description produces a realistic spread across all three score bands.

Regenerate them any time with:

python cv_generator.py

Troubleshooting


Tech Stack

Python 3.13 · Streamlit · PyPDF2 · scikit-learn (TF-IDF, cosine similarity) · Pandas / NumPy · Plotly · Groq API (Llama 3.1 8B Instant) · ReportLab (sample CV generation) · python-dotenv

No PyTorch, no FAISS, no GPU required - runs on any Windows, macOS or Linux machine.


Author

Hafiz Muhammad Faizan


⭐ If you found this project helpful, consider giving it a star!