cv-assistant / app.py
kaustuv Kunal
UI statement of use case added
6cbf2a3
import streamlit as st
from cv_evaluator import profile
import logging
import warnings
# Ignore all warnings
warnings.filterwarnings("ignore")
# Set up logging configuration
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
# Streamlit setup
st.header("CV Assistant for Recruiters & Applicants", divider="blue")
# Display the formatted output
st.markdown('''
*Introducing a GenAI-powered app designed to aid the hiring process for both recruiters and applicants.*
- **For Recruiters:** The app automatically analyzes resumes against job descriptions, generates ATS (Applicant Tracking System) compatibility scores, and helps recruiters quickly identify candidates to move forward in the hiring process.
- **For Applicants:** It evaluates resume alignment with the job description, provides actionable recommendations for improvement, and even generates an updated, optimized resume to enhance selection chances.
''')
# User Type Selection
st.subheader("Select your Role ( Recruiter or Applicant)",divider=True)
user_type = st.radio(
" Select anyone :",
options=["Recruiter", "Applicant"]
)
st.subheader("Upload Resume (in PDF form)",divider=True)
pdf_doc = st.file_uploader("Upload Resume in PDF format:", type=['pdf'])
st.subheader("Enter the Job Description πŸ“‹", divider=True)
job_desc = st.text_area("Paste the Job Description Below:", max_chars=10000)
if st.button("Invoke CV Assistant"):
try:
logging.info("Processing user input.")
if not pdf_doc:
st.error("Please upload a resume.")
elif not job_desc.strip():
st.error("Please enter the job description.")
else:
# Call profile function with user_type
result = profile(pdf_doc=pdf_doc, job_desc=job_desc, user_type=user_type)
st.markdown(result)
logging.info("Results displayed successfully.")
except Exception as e:
st.error(f"An error occurred: {str(e)}")
logging.error(f"Error processing input: {e}")