Skip to main content

Command Palette

Search for a command to run...

AI-Powered Resume Shortlisting Using Python + ChatGPT API

Updated
4 min read
S

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.

🔍 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