AI-Powered Resume Shortlisting Using Python + ChatGPT API

Sandeep BhattSandeep Bhatt
4 min read

πŸ” Introduction

Resume shortlisting is one of the most time-consuming tasks for HR and recruitment teams. With hundreds of applications for each opening, manually reviewing every resume is not only inefficient but also prone to bias and inconsistency.

In this project, I built a smart AI-powered resume shortlisting tool using Python and the ChatGPT API, which evaluates resumes against a job description and provides a structured recommendation β€” all without any manual review!

πŸš€ What This Project Does

βœ… Reads resumes (PDF format) from a folder
βœ… Reads a plain text Job Description (JD)
βœ… Sends both to ChatGPT via API
βœ… Gets back:

  • A relevance score (0–10)

  • Candidate strengths

  • Gaps (if any)

  • Final recommendation: Shortlist or Reject
    βœ… Saves everything to a clean Excel report

πŸ”§ Tech Stack

  • Python

  • PyPDF2 – to extract text from PDF resumes

  • OpenAI GPT-3.5 API – for intelligent evaluation

  • pandas – for Excel reporting

πŸ—οΈ Folder Structure

The folder structure for your project is organized as follows:

  • resume_filter_project/

    • job_description.txt – Contains the job role details.

    • resumes/ – A folder containing PDF resumes.

      • john_doe.pdf

      • meera_singh.pdf

    • resume_filter.py – The main script for the project.

    • Resume_Evaluation_Report.xlsx – The output report containing the evaluation results.

🧠 Prompt Used for ChatGPT

You are an expert recruiter.

Evaluate this resume against the job description below.

Job Description: [...job description content...]

Resume: [...resume content...]

Please answer:

  1. Relevance Score (0–10):

  2. Key Strengths:

  3. Weak Areas (if any):

  4. Final Recommendation (Shortlist/Reject):

πŸ’» Full Python Script (resume_filter.py)

import os
import PyPDF2
import openai
import pandas as pd

# Set your OpenAI API key
openai.api_key = "your-openai-api-key"

# Load job description
with open("job_description.txt", "r", encoding="utf-8") as f:
    job_description = f.read()

# Folder containing resumes
resume_folder = "resumes"
evaluations = []

# Loop through PDF resumes
for file in os.listdir(resume_folder):
    if file.lower().endswith(".pdf"):
        with open(os.path.join(resume_folder, file), "rb") as f:
            reader = PyPDF2.PdfReader(f)
            resume_text = "".join([page.extract_text() or "" for page in reader.pages])

        prompt = f"""
You are an expert recruiter.

Evaluate this resume against the job description below.

Job Description:
{job_description}

Resume:
{resume_text}

Please answer:
1. Relevance Score (0–10):
2. Key Strengths:
3. Weak Areas (if any):
4. Final Recommendation (Shortlist/Reject):
"""

        # Call ChatGPT API
        response = openai.ChatCompletion.create(
            model="gpt-3.5-turbo",
            messages=[{"role": "user", "content": prompt}],
            temperature=0.3
        )

        evaluations.append({
            "Resume": file,
            "Evaluation": response.choices[0].message.content.strip()
        })

# Save to Excel
df = pd.DataFrame(evaluations)
df.to_excel("Resume_Evaluation_Report.xlsx", index=False)
print("βœ… Evaluation complete. Report saved.")

πŸ“Š Sample Output

ResumeEvaluation
john_doe.pdfScore: 8/10. Strong in Python, lacks Power BI. Recommendation: Shortlist
meera.pdfScore: 5/10. Experience not aligned with JD. Recommendation: Reject

πŸ“£ Real-World Use Cases

This project can be adapted for:

  • HR tech startups

  • Recruitment firms

  • In-house HR teams automating hiring

  • Freelancers helping clients filter talent

πŸ’° API Cost Estimation (ChatGPT)

🧾 Chosen Model for Resume Project: GPT-4.1 nano

(Fastest, most cost-effective model as of May 2025)

Token TypePrice per 1M Tokens
Input Tokens$0.10
Output Tokens$0.40

πŸ“„ Cost per Resume Evaluation (Approximate):

ComponentEstimated TokensApprox Cost
Job Description500$0.00005
Resume Content1500$0.00015
Output (Response)400$0.00016
Total per Resume~2,400~$0.00036 (β‚Ή0.03)

πŸ“Š Bulk Evaluation Cost (GPT-4.1 nano):

No. of ResumesApprox Cost (USD)Approx Cost (INR)
100~$0.04β‚Ή3.3
500~$0.18β‚Ή15–16
1,000~$0.36β‚Ή30–35

πŸ” This means you can screen 1,000 resumes for less than β‚Ή40 β€” making this tool incredibly scalable and affordable.

πŸ“’ Let’s Connect!

If you're working on automation or AI tools in HR, finance, or operations, I’d love to connect and learn from your journey.

Follow me here or on LinkedIn for future posts!

πŸ‘‡ Drop your thoughts or feedback in the comments!

#Python #ChatGPT #AIProjects #Automation #Recruitment #CareerSwitch #OpenAI #PortfolioProject #PowerAutomate #TechForHR

0
Subscribe to my newsletter

Read articles from Sandeep Bhatt directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sandeep Bhatt
Sandeep Bhatt

Process Automation Expert | Excel VBA & Power Automate Specialist | AI + RPA Explorer After 13 years of building automation solutions in Excel and VBA β€” from payroll systems to complex F&F workflows β€” I now focus on designing modern, intelligent automations using Microsoft Power Automate, RPA, and AI-powered tools. I’m deeply interested in how prompt engineering, generative AI, and cloud-connected flows can replace repetitive work with smart, self-operating systems. My goal is simple: make operations faster, error-free, and future-proof. When I’m not automating Excel or building flows, I’m testing how AI can enhance decision-making and bring creative automation into everyday business.