JishnuSetia commited on
Commit
e6e3f07
·
verified ·
1 Parent(s): 3c86aac

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +56 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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() ## load all our environment variables
9
+
10
+ os.getenv("GOOGLE_API_KEY")
11
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
12
+
13
+
14
+
15
+ def get_gemini_repsonse(input):
16
+ model=genai.GenerativeModel('gemini-pro')
17
+ response=model.generate_content(input)
18
+ return response.text
19
+
20
+ def input_pdf_text(uploaded_file):
21
+ reader=pdf.PdfReader(uploaded_file)
22
+ text=""
23
+ for page in range(len(reader.pages)):
24
+ page=reader.pages[page]
25
+ text+=str(page.extract_text())
26
+ return text
27
+
28
+ #Prompt Template
29
+
30
+ input_prompt="""
31
+ Act Like a skilled or very experience ATS(Application Tracking System)
32
+ 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 the missing keywords with high accuracy
36
+ resume:{text}
37
+ description:{jd}
38
+ I want the response in Three blocks having the structure
39
+ JD Match:"%"
40
+ MissingKeywords:[]
41
+ Tips to Improve the Resume for Higher Match:""}}
42
+ """
43
+
44
+ ## streamlit app
45
+ st.title("DDS Smart ATS")
46
+ st.text("Improve Your Resume ATS Score Match")
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=get_gemini_repsonse(input_prompt)
56
+ st.subheader(response)
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ streamlit
2
+ PyPDF2
3
+ google.generativeai
4
+ python-dotenv