Freedom Sale
Independence Day Special — Unlock the AI Path 70% off our most popular AI course · Limited time offer
--Days
--Hrs
--Min
--Sec
Claim Your Discount
✦ Beginner ⏱ 35 min

📄 Build an AI Resume Screener with Gemini

🎯 What You'll Build

A tool that reads a CV and a job description, then gives a match score, a list of strengths, and the gaps a candidate needs to fill.

📋 What You'll Need

1

Extract text from a PDF CV

Use PyPDF2 to pull raw text from a resume PDF.

import PyPDF2

def extract_pdf_text(path):
    with open(path, "rb") as f:
        reader = PyPDF2.PdfReader(f)
        return "\n".join(page.extract_text() for page in reader.pages)

cv_text = extract_pdf_text("resume.pdf")
print(cv_text[:300])
2

Write the scoring prompt

Give Gemini a structured prompt so it returns a consistent analysis.

JOB_DESC = """
We are looking for a Python Developer with 2+ years of experience.
Required skills: Python, Django or Flask, PostgreSQL, REST APIs, Git.
Nice to have: Docker, AWS, React.
"""

PROMPT = f"""
You are a technical recruiter. Analyse this CV against the job description.

JOB DESCRIPTION:
{JOB_DESC}

CANDIDATE CV:
{cv_text}

Return a JSON object with:
- score: integer 0-100
- strengths: list of 3 bullet points
- gaps: list of 3 bullet points
- verdict: one sentence summary
"""
3

Send to Gemini and parse the result

Call the API and display the structured output.

import google.generativeai as genai, json, re

genai.configure(api_key="YOUR_GEMINI_API_KEY")
model = genai.GenerativeModel("gemini-1.5-flash")

response = model.generate_content(PROMPT)
raw = response.text

# Extract JSON from the response
json_str = re.search(r'\{.*\}', raw, re.DOTALL).group()
result = json.loads(json_str)

print(f"Match Score: {result['score']}/100")
print(f"Verdict: {result['verdict']}")
print("\nStrengths:")
for s in result['strengths']: print(f"  ✓ {s}")
print("\nGaps:")
for g in result['gaps']: print(f"  ✗ {g}")
Match Score: 72/100
Verdict: Strong Python background but lacks Docker and AWS experience required for this role.

Strengths:
  ✓ 3 years of Python experience with Flask REST APIs
  ✓ Solid PostgreSQL database skills demonstrated in two projects
  ✓ Active GitHub profile with relevant open-source contributions

Gaps:
  ✗ No Docker or containerisation experience mentioned
  ✗ No AWS or cloud deployment skills listed
  ✗ Django not mentioned despite being a core requirement
💡 Tip: Add a simple loop to screen multiple CVs from a folder — batch screening a pile of applications takes seconds instead of hours.

🎉 You Did It!

Your resume screener gives consistent, structured feedback in seconds. Build a Streamlit front-end around it for a proper HR tool.

Found something wrong?

Spotted a bug, broken code, or something that doesn't look right? Tell us what's off and we'll fix it.