In today’s fast-paced hiring environment, resume screening plays a critical role in identifying the best candidates efficiently. With companies receiving hundreds of applications for a single role, building a smart and reliable Applicant Tracking System (ATS) is no longer optional, it’s essential.
This guide walks you through a refined approach to creating a smoother, more intelligent end-to-end resume evaluation system that uses AI to analyze resumes against job descriptions—without the technical setup headaches.
Instead of converting PDFs to images, this improved system extracts text directly using PyPDF2, a lightweight Python library built specifically for reading PDF content. This update:
To get started, create a clean Python environment using conda and install the necessary libraries. Here’s a detailed chat:
Step | Description | Tools/Libraries |
Environment Setup | Create and activate Python 3.10 environment | conda, python=3.10 |
Install Dependencies | Load required libraries | PyPDF2, streamlit, google-generative-ai |
API keys for the AI model should be securely stored using environment variables to protect sensitive information.
The system uses Google Generative AI to evaluate resumes based on job descriptions. This is where the real power of the system lies—prompt engineering guides the AI to act like an experienced recruiter or ATS engine.
The AI is instructed to:
“Act as an experienced applicant tracking system. Analyze the resume against the job description. Provide a match score, list of missing keywords, and recommendations for improvement.”
Securely load your Gemini API key using dotenv and initialize the Gemini SDK.
from dotenv import load_dotenv import google.generativeai as genai import os # Load .env file load_dotenv() # Configure Gemini genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
2. Convert Resume PDF to Image for Gemini Input
Convert the first page of a PDF resume into a base64-encoded image for Gemini’s input.
import io import base64 from PIL import Image import pdf2image
def input_pdf_setup(uploaded_file): poppler_path = r"C:Program Files (x86)popplerLibrarybin" # Convert PDF to images images = pdf2image.convert_from_bytes(uploaded_file.read(), poppler_path=poppler_path) # Get the first page as image first_page = images[0] # Convert image to byte array img_byte_arr = io.BytesIO() first_page.save(img_byte_arr, format='JPEG') img_byte_arr = img_byte_arr.getvalue() # Return base64-encoded image data return [{ "mime_type": "image/jpeg", "data": base64.b64encode(img_byte_arr).decode() }]
Use Gemini’s generative model to analyze the resume against a job description.
def get_gemini_response(prompt, pdf_content, job_description): model = genai.GenerativeModel('gemini-1.5-flash') response = model.generate_content([prompt, pdf_content[0], job_description]) return response.text
Create a user-friendly interface to upload resumes and input job descriptions.
import streamlit as st # Set page configuration st.set_page_config(page_title="ATS Resume Expert") # Page title and description st.title("ATS Resume Analyzer") st.markdown("Upload your resume and paste a job description to get instant AI feedback.") # Job description input input_text = st.text_area("Job Description:") # File uploader for resume uploaded_file = st.file_uploader("Upload Resume (PDF)", type=["pdf"]) # Upload success message if uploaded_file: st.success("Resume uploaded successfully!")
Trigger Gemini-powered resume evaluation, improvement suggestions, or ATS match scoring.
# Evaluate Resume button if st.button("Evaluate Resume"): pdf_content = input_pdf_setup(uploaded_file) st.write(get_gemini_response(prompt_eval, pdf_content, input_text)) # Improve Resume button if st.button("Improve Resume"): pdf_content = input_pdf_setup(uploaded_file) st.write(get_gemini_response(prompt_improve, pdf_content, input_text)) # Match Score button if st.button("Match Score"): pdf_content = input_pdf_setup(uploaded_file) st.write(get_gemini_response(prompt_match, pdf_content, input_text))
Customize Gemini’s behavior using specialized prompts for evaluation, optimization, and matching.
prompt_eval = "You are an HR expert... [resume evaluation instructions]" prompt_improve = "You are a resume consultant... [resume improvement instructions]" prompt_match = "You are an ATS scanner... [percentage match instructions]"
A Streamlit web app makes this solution easy to use, even for non-technical users. The app allows you to:
No complex setup. Just a clean, functional interface.
In today’s automated hiring process, it’s important to be smart about how you stand out.
With this clean and modern approach to resume analysis, you can:
It’s time to transform your resume screening process into something smarter—and simpler.
Neha Vittal Annam