Surat96 commited on
Commit
d9f6306
Β·
verified Β·
1 Parent(s): 581207a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -75
app.py CHANGED
@@ -6,7 +6,7 @@ import json
6
 
7
 
8
 
9
- def get_gemini_repsonse(prompt,pdf_content,input):
10
  model=genai.GenerativeModel('gemini-1.5-pro')
11
  response=model.generate_content(input)
12
  return response.text
@@ -20,7 +20,23 @@ def input_pdf_text(uploaded_file):
20
  return text
21
 
22
 
 
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  ## streamlit app
26
  st.header("🎊 Smart Resume ATS πŸ“‘πŸ«°")
@@ -30,82 +46,13 @@ uploaded_file=st.file_uploader("Upload Your Resume",type="pdf",help="Please upla
30
  if uploaded_file is not None:
31
  st.write("PDF Uploaded Successfully")
32
 
 
33
 
34
-
35
-
36
- submit1 = st.button("Tell Me About the Resume")
37
-
38
- submit2 = st.button("How Can I Improvise my Skills")
39
-
40
- submit3 = st.button("What are the Keywords That are Missing")
41
-
42
- submit4 = st.button("Percentage match")
43
-
44
-
45
-
46
- #Prompt Template
47
-
48
- input_prompt1 = """
49
- You are an experienced Technical Human Resource Manager,your task is to review the provided resume against the job description.
50
- Please share your professional evaluation on whether the candidate's profile aligns with the role.
51
- Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements.
52
- """
53
-
54
- input_prompt2 = """
55
- You are an Technical Human Resource Manager with expertise in data science,
56
- your role is to scrutinize the resume in light of the job description provided.
57
- Share your insights on the candidate's suitability for the role from an HR perspective.
58
- Additionally, offer advice on enhancing the candidate's skills and identify areas where improvement is needed.
59
- """
60
-
61
- input_prompt3 = """
62
- You are an skilled ATS (Applicant Tracking System) scanner with a deep understanding of data science and ATS functionality,
63
- your task is to evaluate the resume against the provided job description. As a Human Resource manager,
64
- assess the compatibility of the resume with the role. Give me what are the keywords that are missing
65
- Also, provide recommendations for enhancing the candidate's skills and identify which areas require further development.
66
- """
67
- input_prompt4 = """
68
- You are an skilled ATS (Applicant Tracking System) scanner with a deep understanding of data science and ATS functionality,
69
- your task is to evaluate the resume against the provided job description. give me the percentage of match if the resume matches
70
- the job description. First the output should come as percentage and then keywords missing and last final thoughts.
71
- """
72
-
73
- if submit1:
74
  if uploaded_file is not None:
75
- pdf_content = input_pdf_text(uploaded_file)
76
- response = get_gemini_response(input_prompt1, pdf_content, jd)
77
- st.subheader("The Response is")
78
- st.write(response)
79
- else:
80
- st.write("Please upload a PDF file to proceed.")
81
-
82
- elif submit2:
83
- if uploaded_file is not None:
84
- pdf_content = input_pdf_text(uploaded_file)
85
- response = get_gemini_response(input_prompt2, pdf_content, jd)
86
- st.subheader("The Response is")
87
- st.write(response)
88
- else:
89
- st.write("Please upload a PDF file to proceed.")
90
-
91
- elif submit3:
92
- if uploaded_file is not None:
93
- pdf_content = input_pdf_text(uploaded_file)
94
- response = get_gemini_response(input_prompt3, pdf_content, jd)
95
- st.subheader("The Response is")
96
- st.write(response)
97
- else:
98
- st.write("Please upload a PDF file to proceed.")
99
-
100
- elif submit4:
101
- if uploaded_file is not None:
102
- pdf_content = input_pdf_text(uploaded_file)
103
- response = get_gemini_response(input_prompt4, pdf_content, jd)
104
- st.subheader("The Response is")
105
- st.write(response)
106
- else:
107
- st.write("Please upload a PDF file to proceed.")
108
-
109
 
110
  footer = """
111
  ---
 
6
 
7
 
8
 
9
+ def get_gemini_repsonse(input):
10
  model=genai.GenerativeModel('gemini-1.5-pro')
11
  response=model.generate_content(input)
12
  return response.text
 
20
  return text
21
 
22
 
23
+ #Prompt Template
24
 
25
+ input_prompt="""
26
+ Hey Act Like a skilled or very experience ATS(Application Tracking System)
27
+ with a deep understanding of tech field,software engineering,data science ,data analyst
28
+ and big data engineer. Your task is to evaluate the resume based on the given job description.
29
+ You must consider the job market is very competitive and you should provide
30
+ best assistance for improving thr resumes. Assign the percentage Matching based
31
+ on Jd and the missing keywords with high accuracy
32
+ resume:{text}
33
+ description:{jd}
34
+
35
+ I want the response in one single string having the structure
36
+ {{"JD Match":"%",
37
+ "MissingKeywords:[]",
38
+ "Profile Summary":""}}
39
+ """
40
 
41
  ## streamlit app
42
  st.header("🎊 Smart Resume ATS πŸ“‘πŸ«°")
 
46
  if uploaded_file is not None:
47
  st.write("PDF Uploaded Successfully")
48
 
49
+ submit = st.button("Submit")
50
 
51
+ if submit:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  if uploaded_file is not None:
53
+ text=input_pdf_text(uploaded_file)
54
+ response=get_gemini_repsonse(input_prompt)
55
+ st.subheader(response)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
 
57
  footer = """
58
  ---