dasarathar
commited on
Commit
•
baba3e2
1
Parent(s):
f6250c4
Add application file
Browse files- .env +3 -0
- app.py +65 -0
- reuirements.txt +6 -0
.env
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
OPENAI_API_KEY=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
|
2 |
+
|
3 |
+
GOOGLE_API_KEY=AIzaSyA4d0tBM0kRg2wmFJStX4vh6uNWKvJ8jV8
|
app.py
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import google.generativeai as genai
|
3 |
+
import os
|
4 |
+
import PyPDF2 as pdf
|
5 |
+
from dotenv import load_dotenv
|
6 |
+
import json
|
7 |
+
|
8 |
+
load_dotenv()
|
9 |
+
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
10 |
+
def get_gemini_response(input, pdf_cotent, prompt):
|
11 |
+
model = genai.GenerativeModel('gemini-pro')
|
12 |
+
response = model.generate_content([input, pdf_content, prompt])
|
13 |
+
return response.text
|
14 |
+
|
15 |
+
def input_pdf_text(uploaded_file):
|
16 |
+
reader=pdf.PdfReader(uploaded_file)
|
17 |
+
text=""
|
18 |
+
for page in range(len(reader.pages)):
|
19 |
+
page=reader.pages[page]
|
20 |
+
text+=str(page.extract_text())
|
21 |
+
return text
|
22 |
+
|
23 |
+
|
24 |
+
## Streamlit App
|
25 |
+
|
26 |
+
st.set_page_config(page_title="ATS Resume EXpert")
|
27 |
+
st.header("ATS Tracking System")
|
28 |
+
input_text = st.text_area("Job Description: ", key="input")
|
29 |
+
uploaded_file = st.file_uploader("Upload your resume(PDF)...", type=["pdf"])
|
30 |
+
|
31 |
+
if uploaded_file is not None:
|
32 |
+
st.write("PDF Uploaded Successfully")
|
33 |
+
submit1 = st.button("Tell Me About the Resume")
|
34 |
+
# submit2 = st.button("How Can I Improvise my Skills")
|
35 |
+
submit3 = st.button("Percentage match")
|
36 |
+
input_prompt1 = """
|
37 |
+
You are an experienced Technical Human Resource Manager,your task is to review the provided resume against the job description, summerize the resume .
|
38 |
+
Please share your professional evaluation on whether the candidate's profile aligns with the job description.
|
39 |
+
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.
|
40 |
+
"""
|
41 |
+
input_prompt3 = """
|
42 |
+
You are an skilled ATS (Applicant Tracking System) scanner with a deep understanding of software engineering , .net framework and ATS functionality,
|
43 |
+
your task is to evaluate the resume against the provided job description. give me the percentage of match if the resume matches with
|
44 |
+
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,
|
45 |
+
last final thoughts and don't provide data which is not present in the resume.
|
46 |
+
"""
|
47 |
+
|
48 |
+
if submit1:
|
49 |
+
if uploaded_file is not None:
|
50 |
+
pdf_content = input_pdf_text(uploaded_file)
|
51 |
+
response = get_gemini_response(input_prompt1, pdf_content, input_text)
|
52 |
+
st.subheader("The Response is")
|
53 |
+
st.write(response)
|
54 |
+
else:
|
55 |
+
st.write("Please upload the resume")
|
56 |
+
|
57 |
+
elif submit3:
|
58 |
+
if uploaded_file is not None:
|
59 |
+
pdf_content = input_pdf_text(uploaded_file)
|
60 |
+
response = get_gemini_response(input_prompt3, pdf_content, input_text)
|
61 |
+
st.subheader("The Repsonse is")
|
62 |
+
st.write(response)
|
63 |
+
else:
|
64 |
+
st.write("Please uplaod the resume")
|
65 |
+
|
reuirements.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
google-generativeai
|
3 |
+
python-dotenv
|
4 |
+
PyPDF2
|
5 |
+
|
6 |
+
|