Spaces:
Runtime error
Runtime error
Ats
Browse files- app.py +58 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import google.generativeai as genai
|
3 |
+
import os
|
4 |
+
from dotenv import load_dotenv
|
5 |
+
import json
|
6 |
+
import PyPDF2 as pdf
|
7 |
+
|
8 |
+
load_dotenv()
|
9 |
+
|
10 |
+
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
11 |
+
|
12 |
+
def get_gemini_response(input):
|
13 |
+
model= genai.GenerativeModel("gemini-pro")
|
14 |
+
response= model.generate_content(input)
|
15 |
+
return response.text
|
16 |
+
|
17 |
+
|
18 |
+
def input_pdf_text(uploaded_file):
|
19 |
+
reader=pdf.PdfReader(uploaded_file)
|
20 |
+
text=""
|
21 |
+
for page in range(len(reader.pages)):
|
22 |
+
page= reader.pages[page]
|
23 |
+
text+= str(page.extract_text())
|
24 |
+
|
25 |
+
return text
|
26 |
+
|
27 |
+
# Prompt template
|
28 |
+
|
29 |
+
input_prompt="""
|
30 |
+
Act like a very skilled or very experienced ATS(Application Tracking System) with a a deep understanding of tech field,
|
31 |
+
software engineering, data science, data analyst, machine learning engineer, and big data engineer.Your task is to evaluate
|
32 |
+
the resume based on the given job description.
|
33 |
+
You must consider the job market to be very competitive and you should provide the best assistance for improving the resumes.
|
34 |
+
Assign the percentage matching based on given Jd and the missing keywords necessary with high accuracy.
|
35 |
+
|
36 |
+
resume:{text}
|
37 |
+
description:{Jd}
|
38 |
+
|
39 |
+
I want the response in one single string having the structure{{"JD Match":"%","Missing Keywords:[]","Profile":""}}
|
40 |
+
|
41 |
+
|
42 |
+
"""
|
43 |
+
|
44 |
+
|
45 |
+
# Strealit App
|
46 |
+
|
47 |
+
st.title("Smart ATS")
|
48 |
+
st.text("Improve your resume ATS")
|
49 |
+
jd=st.text_area("Paste the Job description here")
|
50 |
+
uploaded_file= st.file_uploader("Upload your resume", type="pdf", help="Please upload the pdf")
|
51 |
+
|
52 |
+
submit=st.button("Submit")
|
53 |
+
|
54 |
+
if submit:
|
55 |
+
if uploaded_file is not None:
|
56 |
+
text= input_pdf_text(uploaded_file)
|
57 |
+
response= get_gemini_response(input_prompt)
|
58 |
+
st.subheader(response)
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
PyPDF2
|
3 |
+
python-dotenv
|
4 |
+
google-generativeai
|