Spaces:
Sleeping
Sleeping
funnyPhani
commited on
Commit
•
16c67ad
1
Parent(s):
079dc09
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import PyPDF2 as pdf
|
3 |
import streamlit as st
|
4 |
from dotenv import load_dotenv
|
5 |
import google.generativeai as genai
|
|
|
|
|
6 |
|
7 |
# Load the environment variables
|
8 |
load_dotenv()
|
@@ -11,76 +101,52 @@ model = genai.GenerativeModel('gemini-1.5-flash-latest')
|
|
11 |
|
12 |
st.set_page_config(page_title="Smart Application Tracking System", page_icon=":robot:")
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
# [data-testid="stAppViewContainer"] > .main {{
|
17 |
-
# background-image: url("https://e0.pxfuel.com/wallpapers/219/656/desktop-wallpaper-purple-color-background-best-for-your-mobile-tablet-explore-color-cool-color-colored-background-one-color-aesthetic-one-color.jpg");
|
18 |
-
# background-size: 180%;
|
19 |
-
# background-position: top left;
|
20 |
-
# background-repeat: no-repeat;
|
21 |
-
# background-attachment: local;
|
22 |
-
# }}
|
23 |
-
|
24 |
-
# [data-testid="stHeader"] {{
|
25 |
-
# background: rgba(0,0,0,0);
|
26 |
-
# }}
|
27 |
-
|
28 |
-
# [data-testid="stToolbar"] {{
|
29 |
-
# right: 2rem;
|
30 |
-
# }}
|
31 |
-
# </style>
|
32 |
-
# """
|
33 |
-
|
34 |
-
# st.markdown(page_bg_img, unsafe_allow_html=True)
|
35 |
|
|
|
|
|
|
|
|
|
|
|
36 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
-
|
39 |
-
st.
|
40 |
-
st.text("Improve Your Resume ATS Score")
|
41 |
-
jd=st.text_area("Paste the Job Description")
|
42 |
-
uploaded_file=st.file_uploader("Upload Your Resume",type="pdf",help="Please uplaod the pdf")
|
43 |
|
44 |
submit = st.button("Submit")
|
45 |
|
46 |
if submit:
|
47 |
-
if uploaded_file is not None:
|
48 |
-
reader=pdf.PdfReader(uploaded_file)
|
49 |
-
extracted_text=""
|
50 |
for page in range(len(reader.pages)):
|
51 |
-
page=reader.pages[page]
|
52 |
-
extracted_text+=str(page.extract_text())
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
Resume: {extracted_text}
|
69 |
-
Job Description: {jd}
|
70 |
-
"""
|
71 |
-
|
72 |
-
# input_prompt=f"""
|
73 |
-
# You are a skilled and very experience ATS(Application Tracking System) with a deep understanding of tech field,software engineering,
|
74 |
-
# data science ,data analyst, and big data engineer. Your task is to evaluate the resume based on the given job description.
|
75 |
-
# You must consider the job market is very competitive and you should provide best assistance for improving thr resumes.
|
76 |
-
# Assign the percentage Matching based on Job description and the missing keywords with high accuracy
|
77 |
-
# Resume:{extracted_text}
|
78 |
-
# Description:{jd}
|
79 |
-
|
80 |
-
# I want the only response in 3 sectors as follows:
|
81 |
-
# • Job Description Match: \n
|
82 |
-
# • MissingKeywords: \n
|
83 |
-
# • Profile Summary: should be based on the {extracted_text} in short and concise manner.\n
|
84 |
-
# """
|
85 |
response = model.generate_content(input_prompt)
|
86 |
-
st.write(response.text)
|
|
|
|
|
|
1 |
+
# import os
|
2 |
+
# import PyPDF2 as pdf
|
3 |
+
# import streamlit as st
|
4 |
+
# from dotenv import load_dotenv
|
5 |
+
# import google.generativeai as genai
|
6 |
+
|
7 |
+
# # Load the environment variables
|
8 |
+
# load_dotenv()
|
9 |
+
# genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
10 |
+
# model = genai.GenerativeModel('gemini-1.5-flash-latest')
|
11 |
+
|
12 |
+
# st.set_page_config(page_title="Smart Application Tracking System", page_icon=":robot:")
|
13 |
+
|
14 |
+
# # page_bg_img = f"""
|
15 |
+
# # <style>
|
16 |
+
# # [data-testid="stAppViewContainer"] > .main {{
|
17 |
+
# # background-image: url("https://e0.pxfuel.com/wallpapers/219/656/desktop-wallpaper-purple-color-background-best-for-your-mobile-tablet-explore-color-cool-color-colored-background-one-color-aesthetic-one-color.jpg");
|
18 |
+
# # background-size: 180%;
|
19 |
+
# # background-position: top left;
|
20 |
+
# # background-repeat: no-repeat;
|
21 |
+
# # background-attachment: local;
|
22 |
+
# # }}
|
23 |
+
|
24 |
+
# # [data-testid="stHeader"] {{
|
25 |
+
# # background: rgba(0,0,0,0);
|
26 |
+
# # }}
|
27 |
+
|
28 |
+
# # [data-testid="stToolbar"] {{
|
29 |
+
# # right: 2rem;
|
30 |
+
# # }}
|
31 |
+
# # </style>
|
32 |
+
# # """
|
33 |
+
|
34 |
+
# # st.markdown(page_bg_img, unsafe_allow_html=True)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
# ## streamlit app
|
39 |
+
# st.title("SMART APPLICATION TRACKING SYSTEM")
|
40 |
+
# st.text("Improve Your Resume ATS Score")
|
41 |
+
# jd=st.text_area("Paste the Job Description")
|
42 |
+
# uploaded_file=st.file_uploader("Upload Your Resume",type="pdf",help="Please uplaod the pdf")
|
43 |
+
|
44 |
+
# submit = st.button("Submit")
|
45 |
+
|
46 |
+
# if submit:
|
47 |
+
# if uploaded_file is not None:
|
48 |
+
# reader=pdf.PdfReader(uploaded_file)
|
49 |
+
# extracted_text=""
|
50 |
+
# for page in range(len(reader.pages)):
|
51 |
+
# page=reader.pages[page]
|
52 |
+
# extracted_text+=str(page.extract_text())
|
53 |
+
# #Prompt Template
|
54 |
+
# input_prompt=f"""
|
55 |
+
# 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.
|
56 |
+
|
57 |
+
# Your response should focus on the following three areas:
|
58 |
+
|
59 |
+
# 1. **Job Description Match:**
|
60 |
+
# 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.
|
61 |
+
|
62 |
+
# 2. **Missing Keywords:**
|
63 |
+
# 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.
|
64 |
+
|
65 |
+
# 3. **Profile Summary:**
|
66 |
+
# 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.
|
67 |
+
|
68 |
+
# Resume: {extracted_text}
|
69 |
+
# Job Description: {jd}
|
70 |
+
# """
|
71 |
+
|
72 |
+
# # input_prompt=f"""
|
73 |
+
# # You are a skilled and very experience ATS(Application Tracking System) with a deep understanding of tech field,software engineering,
|
74 |
+
# # data science ,data analyst, and big data engineer. Your task is to evaluate the resume based on the given job description.
|
75 |
+
# # You must consider the job market is very competitive and you should provide best assistance for improving thr resumes.
|
76 |
+
# # Assign the percentage Matching based on Job description and the missing keywords with high accuracy
|
77 |
+
# # Resume:{extracted_text}
|
78 |
+
# # Description:{jd}
|
79 |
+
|
80 |
+
# # I want the only response in 3 sectors as follows:
|
81 |
+
# # • Job Description Match: \n
|
82 |
+
# # • MissingKeywords: \n
|
83 |
+
# # • Profile Summary: should be based on the {extracted_text} in short and concise manner.\n
|
84 |
+
# # """
|
85 |
+
# response = model.generate_content(input_prompt)
|
86 |
+
# st.write(response.text)
|
87 |
+
|
88 |
+
|
89 |
import os
|
90 |
import PyPDF2 as pdf
|
91 |
import streamlit as st
|
92 |
from dotenv import load_dotenv
|
93 |
import google.generativeai as genai
|
94 |
+
from PIL import Image
|
95 |
+
import pytesseract
|
96 |
|
97 |
# Load the environment variables
|
98 |
load_dotenv()
|
|
|
101 |
|
102 |
st.set_page_config(page_title="Smart Application Tracking System", page_icon=":robot:")
|
103 |
|
104 |
+
st.title("SMART APPLICATION TRACKING SYSTEM")
|
105 |
+
st.text("Improve Your Resume ATS Score")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
+
# Job description input
|
108 |
+
jd_option = st.radio(
|
109 |
+
"How would you like to provide the Job Description?",
|
110 |
+
("Text Input", "Upload Image")
|
111 |
+
)
|
112 |
|
113 |
+
if jd_option == "Text Input":
|
114 |
+
jd = st.text_area("Paste the Job Description")
|
115 |
+
else:
|
116 |
+
jd_image = st.file_uploader("Upload Job Description Image", type=["png", "jpg", "jpeg"], help="Please upload the job description image.")
|
117 |
+
if jd_image is not None:
|
118 |
+
image = Image.open(jd_image)
|
119 |
+
jd = pytesseract.image_to_string(image)
|
120 |
+
st.text_area("Extracted Job Description", jd)
|
121 |
|
122 |
+
# Resume upload
|
123 |
+
uploaded_file = st.file_uploader("Upload Your Resume", type="pdf", help="Please upload the PDF")
|
|
|
|
|
|
|
124 |
|
125 |
submit = st.button("Submit")
|
126 |
|
127 |
if submit:
|
128 |
+
if uploaded_file is not None and jd:
|
129 |
+
reader = pdf.PdfReader(uploaded_file)
|
130 |
+
extracted_text = ""
|
131 |
for page in range(len(reader.pages)):
|
132 |
+
page = reader.pages[page]
|
133 |
+
extracted_text += str(page.extract_text())
|
134 |
+
|
135 |
+
# Prompt Template
|
136 |
+
input_prompt = f"""
|
137 |
+
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.
|
138 |
+
Your response should focus on the following three areas:
|
139 |
+
1. **Job Description Match:**
|
140 |
+
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.
|
141 |
+
2. **Missing Keywords:**
|
142 |
+
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.
|
143 |
+
3. **Profile Summary:**
|
144 |
+
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.
|
145 |
+
Resume: {extracted_text}
|
146 |
+
Job Description: {jd}
|
147 |
+
"""
|
148 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
response = model.generate_content(input_prompt)
|
150 |
+
st.write(response.text)
|
151 |
+
else:
|
152 |
+
st.error("Please upload both a resume and a job description.")
|