udayr commited on
Commit
763efed
·
verified ·
1 Parent(s): 2f4bd0d

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +56 -0
app.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # importing libraries
2
+ from dotenv import load_dotenv
3
+ import streamlit as st
4
+ import google.generativeai as genai
5
+ import PyPDF2 as pdf
6
+ import os
7
+
8
+ # load the environment variables
9
+ load_dotenv()
10
+
11
+ # configure Google API Key
12
+ genai.configure(api_key=os.getenv('GOOGLE_API_KEY'))
13
+
14
+ # Gemini Pro Response
15
+ def get_gemini_response(input):
16
+ model = genai.GenerativeModel('gemini-pro')
17
+ response = model.generate_content(input)
18
+ return response.text
19
+
20
+ # extract the image
21
+ def input_pdf_text(uploaded_file):
22
+ reader=pdf.PdfReader(uploaded_file)
23
+ text=""
24
+ for page in range(len(reader.pages)):
25
+ page=reader.pages[page]
26
+ text+=str(page.extract_text())
27
+ return text
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("Smart 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=get_gemini_response(input_prompt)
56
+ st.subheader(response)