Skip to content

Commit

Permalink
Merge pull request #554 from Niraj1608/ATS
Browse files Browse the repository at this point in the history
✨[FEATURE] Resume Application Tracking System(ATS) Using Google Gemini Pro Vision LIM Model #440
  • Loading branch information
suryanshsk authored Nov 9, 2024
2 parents e3d6b85 + df65ecf commit f111f66
Show file tree
Hide file tree
Showing 5 changed files with 172 additions and 0 deletions.
72 changes: 72 additions & 0 deletions Resume Application Tracking System(ATS)/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@


# ATS Resume Expert

ATS Resume Expert is a Streamlit-based web application that uses Google's Generative AI (Gemini) model to analyze resumes in PDF format against specific job descriptions. The application evaluates the resume content, providing insights and match percentages to help users understand how well their resume aligns with job requirements.

## Features
- **Resume Analysis**: Upload a PDF resume, and the AI evaluates it based on a provided job description.
- **Job Match Scoring**: The AI provides a match percentage between the resume and job description, highlighting strengths, weaknesses, missing keywords, and more.
- **Streamlit UI**: User-friendly interface with text input for job description and resume upload capability.

## Getting Started

### Prerequisites
1. **Python**: Make sure you have Python 3.7+ installed.
2. **Google API Key**: This project requires access to Google Generative AI's Gemini model. Obtain an API key and configure it in the environment.

### Installation
1. Clone this repository:
```bash
git clone https://github.com/your-username/ATS-Resume-Expert.git
cd ATS-Resume-Expert
```
2. Install the required packages:
```bash
pip install -r requirements.txt
```
Here is a sample `requirements.txt`:
```
streamlit
dotenv
pdf2image
pillow
google-generativeai
```

3. Install **poppler** (required for `pdf2image`):
- **Windows**: [Download Poppler for Windows](http://blog.alivate.com.au/poppler-windows/), extract, and add `poppler/bin` to your PATH.
- **Linux**: Run `sudo apt install poppler-utils`.
- **macOS**: Run `brew install poppler`.

4. Create a `.env` file in the project root with your Google API key:
```
GOOGLE_API_KEY=your_google_api_key
```

### Running the App
1. Start the Streamlit app:
```bash
streamlit run app.py
```

2. Open the provided local URL to access the ATS Resume Expert app.

## Usage
1. **Job Description**: Enter the job description in the text area.
2. **Resume Upload**: Upload a PDF version of the resume.
3. **Analyze Resume**:
- Click **Tell Me About the Resume** to get an evaluation of the resume based on job requirements.
- Click **Percentage Match** to receive a match score along with suggestions for improvement.

## File Structure
- **app.py**: Main application code.
- **README.md**: Documentation for the app.
- **requirements.txt**: List of required Python libraries.
- **.env**: Environment file for API keys (not included in repository).

## Troubleshooting
1. **Poppler Installation**: Ensure Poppler is installed and accessible in your PATH if you encounter PDF processing errors.
2. **API Errors**: Check your Google API key and usage limits if there are issues with the AI model responses.


93 changes: 93 additions & 0 deletions Resume Application Tracking System(ATS)/app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import base64
import streamlit as st
import os
import io
from PIL import Image
import pdf2image
import google.generativeai as genai

genai.configure(api_key=os.getenv("API_KEY"))

def get_gemini_response(input,pdf_cotent,prompt):
model=genai.GenerativeModel('gemini-pro-vision')
response=model.generate_content([input,pdf_content[0],prompt])
return response.text

def input_pdf_setup(uploaded_file):
if uploaded_file is not None:
## Convert the PDF to image
images=pdf2image.convert_from_bytes(uploaded_file.read())

first_page=images[0]

# Convert to bytes
img_byte_arr = io.BytesIO()
first_page.save(img_byte_arr, format='JPEG')
img_byte_arr = img_byte_arr.getvalue()

pdf_parts = [
{
"mime_type": "image/jpeg",
"data": base64.b64encode(img_byte_arr).decode() # encode to base64
}
]
return pdf_parts
else:
raise FileNotFoundError("No file uploaded")

## Streamlit App

st.set_page_config(page_title="ATS Resume EXpert")
st.header("ATS Tracking System")
input_text=st.text_area("Job Description: ",key="input")
uploaded_file=st.file_uploader("Upload your resume(PDF)...",type=["pdf"])


if uploaded_file is not None:
st.write("PDF Uploaded Successfully")


submit1 = st.button("Tell Me About the Resume")

#submit2 = st.button("How Can I Improvise my Skills")

submit3 = st.button("Percentage match")

input_prompt1 = """
You are an experienced Technical Human Resource Manager,your task is to review the provided resume against the job description.
Please share your professional evaluation on whether the candidate's profile aligns with the role.
Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements.
"""

input_prompt3 = """
You are an skilled ATS (Applicant Tracking System) scanner with a deep understanding of data science and ATS functionality,
your task is to evaluate the resume against the provided job description. give me the percentage of match if the resume matches
the job description. First the output should come as percentage and then keywords missing and last final thoughts.
"""

if submit1:
if uploaded_file is not None:
pdf_content=input_pdf_setup(uploaded_file)
response=get_gemini_response(input_prompt1,pdf_content,input_text)
st.subheader("The Repsonse is")
st.write(response)
else:
st.write("Please uplaod the resume")

elif submit3:
if uploaded_file is not None:
pdf_content=input_pdf_setup(uploaded_file)
response=get_gemini_response(input_prompt3,pdf_content,input_text)
st.subheader("The Repsonse is")
st.write(response)
else:
st.write("Please uplaod the resume")









7 changes: 7 additions & 0 deletions Resume Application Tracking System(ATS)/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
streamlit
google-generativeai
python-dotenv
langchain
PyPDF2
faiss-cpu
langchain_google_genai
Binary file not shown.
Binary file not shown.

0 comments on commit f111f66

Please sign in to comment.