import streamlit as st import fitz # PyMuPDF import google.generativeai as genai # Configure the Generative AI model genai.configure(api_key="AIzaSyBfaNzAj-8a7QLWfGmI92SaLXZVqrQABj0") def ai_output(input_text, pdf_text, prompt): model = genai.GenerativeModel('gemini-1.5-flash') combined_input = f"{input_text}\n\n{pdf_text}\n\n{prompt}" response = model.generate_content(combined_input) return response.text def ai_ans(input_text, prompt): model = genai.GenerativeModel('gemini-1.5-flash') combined_input = f"{input_text}\n\n{prompt}" response = model.generate_content(combined_input) return response.text def input_pdf_setup(uploaded_file): if uploaded_file is not None: pdf_document = fitz.open(stream=uploaded_file.read(), filetype="pdf") text = "" for page_num in range(len(pdf_document)): page = pdf_document.load_page(page_num) text += page.get_text() pdf_document.close() return text else: raise FileNotFoundError("No file uploaded") st.set_page_config(page_title="ATS Resume Expert") st.header("HARIMAY ATS Tracking System") input_text = st.text_area("Job Description:", key="input") uploaded_file = st.file_uploader("Upload your resume (PDF)...", type=["pdf"]) job_role = st.text_input("Enter Job Role", key="job") if uploaded_file is not None: pdf_text = input_pdf_setup(uploaded_file) st.write("PDF file uploaded and processed successfully.") else: pdf_text = "" st.write("Please upload the resume.") submit1 = st.button("Tell me about the Resume") submit2 = st.button("Percentage Match") submit3 = st.button("Job Skills") submit4 = st.button("Missing Keywords") input_prompt1 = """ You are an experienced Technical Human Resource Manager. Your task is to review the provided resume against the job description. Please share your professional evaluation on whether the candidate's profile aligns with the role. Highlight the strengths and weaknesses of the applicant in relation to the specified job requirements. """ input_prompt2 = """ You are a skilled ATS (Applicant Tracking System) scanner with a deep understanding of ATS functionality. Your task is to evaluate the resume against the provided job description. Provide the percentage match if the resume aligns with the job description. First, present the output as a percentage, then list missing keywords, and finally, offer your thoughts. """ input_prompt3 = """ You are an advanced career advisor and job market expert with deep insights into various industries. When given a job role, your task is to identify and list the key skills and qualifications that are most commonly required for success in that position. Please provide a structured output that includes: 1. A detailed list of technical and hard skills. 2. A summary of soft skills crucial for the role. 3. Recommended educational qualifications and certifications associated with the job. """ input_prompt4 = """ You are an expert in resume optimization and keyword integration for job applications. I am providing my current resume content and a job description for a specific role. Your task is to: Analyze and Identify Missing Keywords or Skills: Carefully review the job description to identify important keywords, skills, and experiences that are missing from my current resume. Provide a comprehensive list of all missing keywords or skills. Explain the importance of each missing keyword or skill in relation to the role and how it impacts my fit for the position. Detailed Suggestions for Resume Content: For each identified keyword or skill, create a detailed suggestion for a sentence or bullet point that incorporates the keyword or skill naturally into my resume. Specify where the new content should be added (e.g., Professional Experience, Skills, Education, Projects) for the best impact and flow. Ensure all suggestions are tailored to the context of my current experience and maintain coherence throughout my resume. Evaluation of Current Experience Level: Assess my current experience in comparison to the job requirements and highlight if my experience level is below what the role expects. Explain why this gap might affect my chances of being selected for an interview. Strategic Project Suggestions: Recommend specific projects or initiatives I could pursue to gain relevant experience and skills that align with the missing keywords or skills. Provide a brief outline of what these suggested projects should entail and how they would showcase the desired expertise. Resume Enhancement: Integrate the new content and suggestions into an updated version of my resume. Ensure that the updated resume is optimized with all the missing keywords to achieve a high ATS (Applicant Tracking System) score and improve my likelihood of being shortlisted for an interview. The result should be a detailed, customized revision of my resume that highlights my strengths, aligns with the job description, and maximizes my chances of being selected for an interview """ if submit1: if pdf_text: response = ai_output(input_text, pdf_text, input_prompt1) st.subheader("The Response is:") st.write(response) else: st.write("Please upload the resume.") elif submit2: if pdf_text: response = ai_output(input_text, pdf_text, input_prompt2) st.subheader("The Response is:") st.write(response) else: st.write("Please upload the resume.") elif submit3: response = ai_ans(job_role, input_prompt3) st.subheader("The Response is:") st.write(response) elif submit4: if pdf_text: response = ai_output(input_text, pdf_text, input_prompt4) st.subheader("Missing things which need to be present in your resume:") st.write(response)