ayushsinha's picture
Upload 2 files
b0ebef3 verified
import gradio as gr
from transformers import pipeline
def predict_ats_score(job_description, resume):
model = pipeline("text-classification", model="AventIQ-AI/multinomialnb-ats-score-predictor")
input_text = f"Job Description: {job_description}\nResume: {resume}"
result = model(input_text)
return result[0]['label'], round(result[0]['score'] * 100, 2)
custom_css = """
body { background: #1e1e2f; font-family: Arial, sans-serif; color: #ffffff; }
.gradio-container { max-width: 700px; margin: auto; padding: 20px; border-radius: 10px; background: #2a2a3c; box-shadow: 0px 4px 15px rgba(0,0,0,0.2); }
.gr-button { background-color: #ff6b6b; color: white; font-size: 16px; border-radius: 8px; padding: 10px 20px; border: none; cursor: pointer; transition: all 0.3s ease; }
.gr-button:hover { background-color: #ff4757; }
.gr-textbox { background: #3a3a4a; color: white; border-radius: 8px; border: 1px solid #555; padding: 10px; font-size: 14px; }
"""
iface = gr.Interface(
fn=predict_ats_score,
inputs=[
gr.Textbox(label="Job Description", lines=5, placeholder="Enter the job description here...", elem_classes="gr-textbox"),
gr.Textbox(label="Resume", lines=5, placeholder="Enter the resume here...", elem_classes="gr-textbox")
],
outputs=[
gr.Textbox(label="Predicted Score", interactive=False, elem_classes="gr-textbox"),
gr.Textbox(label="Confidence Score (%)", interactive=False, elem_classes="gr-textbox")
],
title="πŸš€ ATS Score Predictor",
description="πŸ” Enter a job description and a resume to predict the ATS score. This will help determine how well a resume matches a job description.",
theme="compact",
css=custom_css
)
iface.launch()