Shivashankar commited on
Commit
c9701ff
1 Parent(s): 2b46698

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +61 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ import streamlit as st
4
+ import google.generativeai as genai
5
+ import PyPDF2 as pdf_load
6
+ from dotenv import load_dotenv
7
+ import json
8
+
9
+ # load all our environment variables
10
+ load_dotenv()
11
+ genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
12
+
13
+
14
+ # set model and get response from Gemini model.
15
+ def get_gemini_repsonse(input):
16
+ model = genai.GenerativeModel('gemini-pro')
17
+ response = model.generate_content(input)
18
+ return response.text
19
+
20
+
21
+ # convert pdf into text
22
+ def input_pdf_text(uploaded_file):
23
+ reader = pdf_load.PdfReader(uploaded_file)
24
+ text = ""
25
+ for page in range(len(reader.pages)):
26
+ page = reader.pages[page]
27
+ text += str(page.extract_text())
28
+ return text
29
+
30
+
31
+ # Prompt Template
32
+
33
+ input_prompt = """
34
+ Hey Act Like a skilled or very experience ATS(Application Tracking System)
35
+ with a deep understanding of tech field,software engineering,data science, Machine Learning, data analyst
36
+ and data engineer. Your task is to evaluate the resume based on the given job description.
37
+ You must consider the job market is very competitive and you should provide
38
+ best assistance for improving the resumes. Assign the percentage Matching based
39
+ on Jd and the missing keywords with high accuracy
40
+ resume:{text}
41
+ description:{jd}
42
+
43
+ I want the response in one single string having the structure
44
+ {{"JD Match":"%","MissingKeywords:[]","Profile Summary":""}}
45
+ """
46
+
47
+ # streamlit app
48
+ st.title("Smart Resume ATS System")
49
+ st.text("Improve Your Resume ATS")
50
+ jd = st.text_area("Paste the Job Description")
51
+ uploaded_file = st.file_uploader("Upload Your Resume", type="pdf", help="Please uplaod the pdf")
52
+
53
+ submit = st.button("Submit")
54
+
55
+ if submit:
56
+ if uploaded_file is not None:
57
+ text = input_pdf_text(uploaded_file)
58
+ response = get_gemini_repsonse(input_prompt)
59
+ st.text_area(response)
60
+
61
+ st.info("Shivashankar")
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ streamlit
2
+ google.generativeai
3
+ python-dotenv
4
+ PyPDF2