Spaces:
Running
Running
import gradio as gr | |
from job import load_default_job_description | |
from category import load_category_description, score_categorization | |
from resume import resume_parser, evaluation_process, scoring_suitability | |
from gradio_pdf import PDF | |
def main_program(resume_link, job_description): | |
resume_text = resume_parser(resume_link) | |
evaluation = evaluation_process(resume_text, job_description) | |
suitabilty_score = scoring_suitability(evaluation) | |
category = score_categorization(suitabilty_score) | |
description = load_category_description(category) | |
return suitabilty_score, category, description, evaluation | |
with gr.Blocks() as iface: | |
gr.Markdown("# π Resume Screener") | |
gr.Markdown("Upload your candidate employee resume and provide job description to evaluate its suitability.") | |
with gr.Row(): | |
with gr.Column(scale=1): | |
resume = PDF(label="Resume (Pdf Only)") | |
with gr.Column(scale=1): | |
job_type = gr.Radio(["Accountant", "UI Designer", "AI Engineer", "Data Scientist", "Other"], label="Job Type") | |
job_description = gr.Textbox(label="Job Description") | |
job_type.change(load_default_job_description, inputs=job_type, outputs=job_description) | |
submit_btn = gr.Button("Submit") | |
with gr.Row(): | |
with gr.Column(): | |
gr.Markdown("## Results") | |
with gr.Row(): | |
score_output = gr.Label(label="Suitability Score") | |
category_output = gr.Label(label="Score Category") | |
gr.Markdown("### Category Description") | |
category_description_output = gr.Markdown(container = True, min_height = 50, max_height=150) | |
gr.Markdown("### Evaluation") | |
evaluation_output = gr.Markdown(container = True, show_copy_button = True, min_height = 450, max_height=450) | |
submit_btn.click( | |
fn=main_program, | |
inputs=[resume, job_description], | |
outputs=[score_output, category_output, category_description_output, evaluation_output] | |
) | |
iface.launch() |