Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| import google.generativeai as genai | |
| import os | |
| import PyPDF2 as pdf | |
| from dotenv import load_dotenv | |
| import json | |
| load_dotenv() ## load all our environment variables | |
| os.getenv("GOOGLE_API_KEY") | |
| genai.configure(api_key=os.getenv("GOOGLE_API_KEY")) | |
| def get_gemini_response(input): | |
| model=genai.GenerativeModel('gemini-pro') | |
| response=model.generate_content(input) | |
| return response.text | |
| def input_pdf_text(uploaded_file): | |
| reader=pdf.PdfReader(uploaded_file) | |
| text="" | |
| for page in range(len(reader.pages)): | |
| page=reader.pages[page] | |
| text+=str(page.extract_text()) | |
| return text | |
| #Prompt Template | |
| input_prompt=""" | |
| Act Like a skilled and very experienced ATS(Application Tracking System). Your task is to evaluate the resume based on the given job description. Consider the job market to be extremely competitive and you must provide the best possible assistance to users for improving their resumes. Assign them percentage matching based on Job Description and the missing keywords with high accuracy | |
| resume:{text} | |
| description:{jd} | |
| Give your response in 4 seperate parts having the structure | |
| JD Match Percentage:"%" | |
| Give a small message saying 'You are a great match' or something based on the percentage | |
| MissingKeywords:[] | |
| Tips to Improve the Resume for Higher Match:""}} | |
| """ | |
| ## streamlit app | |
| st.title("Job Description Matcher by Jishnu Setia") | |
| st.text("Find out if you are the best match for the job") | |
| jd=st.text_area("Paste the Job Description you would like to match with:") | |
| uploaded_file=st.file_uploader("Upload Your Resume:",type="pdf",help="Please uplaod the pdf") | |
| submit = st.button("Submit") | |
| if submit: | |
| if uploaded_file is not None: | |
| text=input_pdf_text(uploaded_file) | |
| response = get_gemini_response(input_prompt.format(text=text, jd=jd)) | |
| st.subheader(response) |