Spaces:
Running
Running
deepshikhar23
commited on
Commit
•
6295fc4
1
Parent(s):
fecfb8c
Upload 2 files
Browse files- app.py +83 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import os
|
3 |
+
import PyPDF2 as pdf
|
4 |
+
import google.generativeai as genai
|
5 |
+
|
6 |
+
# Load environment variables from .env file (assuming it's in the same directory)
|
7 |
+
from dotenv import load_dotenv
|
8 |
+
load_dotenv(dotenv_path = 'C:/Users/HP/ATSapp/.env')
|
9 |
+
|
10 |
+
api_key = os.getenv("GOOGLE_API_KEY")
|
11 |
+
genai.configure(api_key=api_key)
|
12 |
+
|
13 |
+
|
14 |
+
def gemini_response(input, text):
|
15 |
+
model = genai.GenerativeModel('gemini-pro')
|
16 |
+
response = model.generate_content(input)
|
17 |
+
return response.text
|
18 |
+
|
19 |
+
|
20 |
+
def input_pdf_text(uploaded_file):
|
21 |
+
reader = pdf.PdfReader(uploaded_file)
|
22 |
+
text = ""
|
23 |
+
for page in range(0,len(reader.pages)):
|
24 |
+
page = reader.pages[page]
|
25 |
+
text = text + page.extract_text()
|
26 |
+
return text
|
27 |
+
|
28 |
+
|
29 |
+
# Streamlit app here
|
30 |
+
|
31 |
+
st.title("ATS Resume Scanner")
|
32 |
+
st.text("Make your resume ATS friendly")
|
33 |
+
jd = st.text_area("Paste the job description here")
|
34 |
+
uploaded_file = st.file_uploader("Upload your resume", type="pdf", help="Please upload the pdf")
|
35 |
+
|
36 |
+
|
37 |
+
submit1 = st.button("How is my resume?")
|
38 |
+
submit2 = st.button("Tell me the keywords that my resume is missing")
|
39 |
+
submit3 = st.button("Give my resume a matching score out of 10")
|
40 |
+
|
41 |
+
|
42 |
+
if uploaded_file is not None:
|
43 |
+
st.write("Resume uploaded successfully")
|
44 |
+
|
45 |
+
|
46 |
+
prompt1 = '''Suppose you are an experienced technical HR manager with 10 years of experience having expertise in resume review specially for the tech
|
47 |
+
roles like Data Science, Data Analyst, Full Stack Developer, Devops and Data Engineering. Your task is to review the provided resume against the job
|
48 |
+
description. Please share a detailed and honest evaluation on whether the provided resume aligns with the job description with the strengths and
|
49 |
+
weakness of applicant with respect to the provided job description. Here is the resume: '''
|
50 |
+
|
51 |
+
prompt2 = '''Suppose you are an experienced technical HR manager with 10 years of experience having expertise in keyword matching specially for the tech
|
52 |
+
roles like Data Science, Data Analyst, Full Stack Developer, Devops and Data Engineering. Your task is to review the provided resume against the job
|
53 |
+
description. Please make a list of the most appeared keywords in the job description and check if those keywords are already in resume or not?
|
54 |
+
If they are in resume, then it's fine otherwise simply return a list of keywords that are in job description but not in resume. Here is the resume: '''
|
55 |
+
|
56 |
+
prompt3 = '''Suppose you are an experienced technical HR manager with 10 years of experience having expertise in ATS systems specially for the tech
|
57 |
+
roles like Data Science, Data Analyst, Full Stack Developer, Devops and Data Engineering. Your task is to review the provided resume against the job
|
58 |
+
description. Please give the provided resume a score out of 10 based on how much it matches or aligns with the provided job description. If it does not
|
59 |
+
get a 10 simply list out the necessary changes which when made in the resume will make the resume a 10. Here is the resume: '''
|
60 |
+
|
61 |
+
if submit1:
|
62 |
+
if uploaded_file is not None:
|
63 |
+
text = input_pdf_text(uploaded_file)
|
64 |
+
response = gemini_response(prompt1, text)
|
65 |
+
st.subheader(response)
|
66 |
+
else:
|
67 |
+
st.write("Please upload your resume")
|
68 |
+
|
69 |
+
elif submit2:
|
70 |
+
if uploaded_file is not None:
|
71 |
+
text = input_pdf_text(uploaded_file)
|
72 |
+
response = gemini_response(prompt2, text)
|
73 |
+
st.subheader(response)
|
74 |
+
else:
|
75 |
+
st.write("Please upload your resume")
|
76 |
+
|
77 |
+
elif submit3:
|
78 |
+
if uploaded_file is not None:
|
79 |
+
text = input_pdf_text(uploaded_file)
|
80 |
+
response = gemini_response(prompt3, text)
|
81 |
+
st.subheader(response)
|
82 |
+
else:
|
83 |
+
st.write("Please upload your resume")
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
google-generativeai
|
3 |
+
python-dotenv
|
4 |
+
PyPDF2
|