Mr-Vicky-01 commited on
Commit
694acc9
1 Parent(s): f1c1f72

Upload 2 files

Browse files
Files changed (2) hide show
  1. ats.py +75 -0
  2. requirements.txt +4 -0
ats.py ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ import re
8
+ import ast
9
+
10
+ load_dotenv() ## load all our environment variables
11
+
12
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
13
+
14
+ def get_gemini_repsonse(input):
15
+ model=genai.GenerativeModel('gemini-pro')
16
+ response=model.generate_content(input)
17
+ return response.text
18
+
19
+ def input_pdf_text(uploaded_file):
20
+ reader=pdf.PdfReader(uploaded_file)
21
+ text=""
22
+ for page in range(len(reader.pages)):
23
+ page=reader.pages[page]
24
+ text+=str(page.extract_text())
25
+ return text
26
+
27
+ #Prompt Template
28
+
29
+ input_prompt="""
30
+ Hey Act Like a skilled or very experience ATS(Application Tracking System)
31
+ with a deep understanding of tech field,software engineering,data science ,data analyst
32
+ and big data engineer. Your task is to evaluate the resume based on the given job description.
33
+ You must consider the job market is very competitive and you should provide
34
+ best assistance for improving thr resumes. Assign the percentage Matching based
35
+ on Jd and
36
+ the missing keywords with high accuracy
37
+ resume:{text}
38
+ description:{jd}
39
+
40
+ I want the response in one single string having the structure
41
+ {{"JD Match":"%","MissingKeywords:[]","Profile Summary":""}}
42
+ """
43
+
44
+ ## streamlit app
45
+ st.title("Applicant Tracking System (ATS)")
46
+ st.text("Improve Your Resume ATS")
47
+ jd=st.text_area("Paste the Job Description")
48
+ uploaded_file=st.file_uploader("Upload Your Resume",type="pdf",help="Please uplaod the pdf")
49
+
50
+ submit = st.button("Submit")
51
+
52
+ if submit:
53
+ if uploaded_file is not None:
54
+ text=input_pdf_text(uploaded_file)
55
+ response_string=get_gemini_repsonse(input_prompt)
56
+
57
+ # Extract JD match percentage
58
+ jd_match = int(re.search(r'"JD Match":"(\d+)%?"', response_string).group(1))
59
+
60
+ # Extract missing keywords
61
+ missing_keywords = re.search(r'"MissingKeywords":(.*?)]', response_string).group(1) + ']'
62
+ missing_keywords = eval(missing_keywords) # Convert string representation of list to actual list
63
+
64
+ # Extract profile summary
65
+ profile_summary = re.search(r'"Profile Summary":"(.*?)"', response_string).group(1)
66
+
67
+ # Streamlit app
68
+ st.title("Resume Evaluation Result")
69
+ st.write("JD Match:", f"{str(jd_match)}%")
70
+ st.write("Missing Keywords:", missing_keywords)
71
+ st.write("Profile Summary:", profile_summary)
72
+
73
+ # If JD match percentage is more than 80%, display balloons
74
+ if jd_match >= 80:
75
+ st.balloons()
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ streamlit
2
+ PyPDF2
3
+ google.generativeai
4
+ python-dotenv