Spaces:
Sleeping
Sleeping
Upload 3 files
Browse files- .env +1 -0
- app.py +44 -0
- requirements.txt +4 -0
.env
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
GOOGLE_API_KEY="AIzaSyBXaH75cGy75Ve6aIzJKNT1T51TuDcoWxY"
|
app.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
load_dotenv()##loas all the environment variables
|
8 |
+
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
|
9 |
+
##Gemini pro response
|
10 |
+
def get_gemini_response(input):
|
11 |
+
model=genai.GenerativeModel('gemini-pro')
|
12 |
+
response=model.generate_content(input)
|
13 |
+
return response.text
|
14 |
+
def input_pdf_text(uploaded_file):
|
15 |
+
reader=pdf.PdfReader(uploaded_file)
|
16 |
+
text=""
|
17 |
+
for page in range(len(reader.pages)):
|
18 |
+
page=reader.pages[page]
|
19 |
+
text+=str(page.extract_text())
|
20 |
+
return text
|
21 |
+
##Prompt Template
|
22 |
+
input_prompt="""
|
23 |
+
Hey Act like a skilled or very experience ATS(Application Tracking System) with a deep understanding of Generative AI Engineeer,Data Scientist,
|
24 |
+
Machine Learning Engineer,LLM Engineer, and Deep Learning engineer.Your task is to evaluate the resume based on the given job description.You must consider the job market
|
25 |
+
is very competitive and you should provide best assistance for improving the resume.Assign the percentage matching based on
|
26 |
+
job description and the missing keywords with high accuracy
|
27 |
+
resume:{text}
|
28 |
+
description:{jd}
|
29 |
+
|
30 |
+
I want the response in one single string having the structure
|
31 |
+
{{"JD Match":"%","MissingKeywords:[]","Profile Summary":""}}
|
32 |
+
"""
|
33 |
+
##streamlit app
|
34 |
+
st.title("Smart ATS")
|
35 |
+
st.text("Improve your Resume ATS")
|
36 |
+
jd=st.text_area("paste the job description")
|
37 |
+
uploaded_file=st.file_uploader("Upload your Resume",type="pdf",help="Please upload your resume")
|
38 |
+
submit=st.button("Submit")
|
39 |
+
|
40 |
+
if submit:
|
41 |
+
if uploaded_file is not None:
|
42 |
+
text=input_pdf_text(uploaded_file)
|
43 |
+
response=get_gemini_response(input_prompt)
|
44 |
+
st.subheader(response)
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit
|
2 |
+
PyPDF2
|
3 |
+
google.generativeai
|
4 |
+
python-dotenv
|