|
import streamlit as st |
|
import google.generativeai as genai |
|
import os |
|
import PyPDF2 as pdf |
|
from dotenv import load_dotenv |
|
import json |
|
|
|
load_dotenv() |
|
genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) |
|
def get_gemini_response(input, pdf_cotent, prompt): |
|
model = genai.GenerativeModel('gemini-pro') |
|
response = model.generate_content([input, pdf_content, prompt]) |
|
return response.text |
|
|
|
def input_pdf_text(uploaded_file): |
|
reader=pdf.PdfReader(uploaded_file) |
|
text="" |
|
for page in range(len(reader.pages)): |
|
page=reader.pages[page] |
|
text+=str(page.extract_text()) |
|
return text |
|
|
|
|
|
|
|
|
|
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") |
|
|
|
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, summerize the resume . |
|
Please share your professional evaluation on whether the candidate's profile aligns with the job description. |
|
Highlight the strengths and weaknesses of the applicant in relation to the specified job description and don't provide data which is not present in the resume. |
|
""" |
|
input_prompt3 = """ |
|
You are an skilled ATS (Applicant Tracking System) scanner with a deep understanding of software engineering , .net framework 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 with |
|
the job description. First the output should come as percentage , summeri of the resume and then all the keywords or skill set or technology missing from the resume in comparision to the job description, |
|
last final thoughts and don't provide data which is not present in the resume. |
|
""" |
|
|
|
if submit1: |
|
if uploaded_file is not None: |
|
pdf_content = input_pdf_text(uploaded_file) |
|
response = get_gemini_response(input_prompt1, pdf_content, input_text) |
|
st.subheader("The Response is") |
|
st.write(response) |
|
else: |
|
st.write("Please upload the resume") |
|
|
|
elif submit3: |
|
if uploaded_file is not None: |
|
pdf_content = input_pdf_text(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") |
|
|
|
|