Spaces:
Sleeping
Sleeping
File size: 3,318 Bytes
91b6b4c 5d9885c 1f16df9 e9dd43a 1f16df9 5d9885c 1f16df9 5d9885c e9dd43a 5d9885c 1f16df9 e9dd43a 1f16df9 5d9885c 1f16df9 5d9885c 1f16df9 5d9885c 1f16df9 5d9885c bf24140 5d9885c 1f16df9 5d9885c 1f16df9 5d9885c 16c67ad 5d9885c bf24140 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# ATS
import os
import PyPDF2 as pdf
import streamlit as st
from dotenv import load_dotenv
import google.generativeai as genai
from PIL import Image
# Load environment variables
load_dotenv()
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY")
genai.configure(api_key=GOOGLE_API_KEY)
model = genai.GenerativeModel(model_name='gemini-1.5-flash')
st.set_page_config(page_title="Smart Application Tracking System", page_icon=":robot:")
st.title("SMART APPLICATION TRACKING SYSTEM")
st.text("Improve Your Resume ATS Score")
# Job description input
jd_option = st.radio(
"How would you like to provide the Job Description?",
("Text Input", "Upload Image")
)
jd = None
if jd_option == "Text Input":
jd = st.text_area("Paste the Job Description")
else:
jd_image = st.file_uploader("Upload Job Description Image", type=["png", "jpg", "jpeg"], help="Please upload the job description image.")
if jd_image is not None:
jd_image_opened = Image.open(jd_image)
jd = jd_image_opened # Assuming that the API can handle image input directly
# Resume upload
uploaded_file = st.file_uploader("Upload Your Resume", type="pdf", help="Please upload the PDF")
submit = st.button("Submit")
if submit:
if uploaded_file is not None and jd is not None:
# Extract text from the PDF resume
reader = pdf.PdfReader(uploaded_file)
extracted_text = ""
for page in range(len(reader.pages)):
page = reader.pages[page]
extracted_text += str(page.extract_text())
# Create the prompt
input_prompt = f"""
You are an advanced Applicant Tracking System (ATS) with deep expertise in the fields of software engineering, data science, data analysis, and big data engineering. Your primary task is to meticulously evaluate the provided resume against the given job description. The evaluation must account for the highly competitive job market, and you should offer valuable insights for improving the resume's relevance to the job description.
Your response should focus on the following three areas:
1. **Job Description Match:**
Provide a percentage match score based on how well the resume aligns with the job description. This score should consider the candidate's skills, experience, and qualifications in relation to the job requirements.
2. **Missing Keywords:**
Identify and list the key terms and phrases from the job description that are missing from the resume. Highlight those that are critical to the job and may significantly impact the resume's match score.
3. **Profile Summary:**
Create a concise and impactful profile summary based on the information extracted from the resume. The summary should highlight the candidate's most relevant skills, experience, and achievements in a manner that aligns with the job description.
Resume: {extracted_text}
Job Description: {jd if isinstance(jd, str) else "Job Description Image"}
"""
if isinstance(jd, str):
response = model.generate_content([input_prompt])
else:
response = model.generate_content([input_prompt, jd])
st.write(response.text)
else:
st.error("Please upload both a resume and a job description.")
|