Upload 2 files
Browse files- app.py +34 -0
- requirements.txt +8 -0
app.py
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
def predict_ats_score(job_description, resume):
|
5 |
+
model = pipeline("text-classification", model="AventIQ-AI/multinomialnb-ats-score-predictor")
|
6 |
+
input_text = f"Job Description: {job_description}\nResume: {resume}"
|
7 |
+
result = model(input_text)
|
8 |
+
return result[0]['label'], round(result[0]['score'] * 100, 2)
|
9 |
+
|
10 |
+
custom_css = """
|
11 |
+
body { background: #1e1e2f; font-family: Arial, sans-serif; color: #ffffff; }
|
12 |
+
.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); }
|
13 |
+
.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; }
|
14 |
+
.gr-button:hover { background-color: #ff4757; }
|
15 |
+
.gr-textbox { background: #3a3a4a; color: white; border-radius: 8px; border: 1px solid #555; padding: 10px; font-size: 14px; }
|
16 |
+
"""
|
17 |
+
|
18 |
+
iface = gr.Interface(
|
19 |
+
fn=predict_ats_score,
|
20 |
+
inputs=[
|
21 |
+
gr.Textbox(label="Job Description", lines=5, placeholder="Enter the job description here...", elem_classes="gr-textbox"),
|
22 |
+
gr.Textbox(label="Resume", lines=5, placeholder="Enter the resume here...", elem_classes="gr-textbox")
|
23 |
+
],
|
24 |
+
outputs=[
|
25 |
+
gr.Textbox(label="Predicted Score", interactive=False, elem_classes="gr-textbox"),
|
26 |
+
gr.Textbox(label="Confidence Score (%)", interactive=False, elem_classes="gr-textbox")
|
27 |
+
],
|
28 |
+
title="🚀 ATS Score Predictor",
|
29 |
+
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.",
|
30 |
+
theme="compact",
|
31 |
+
css=custom_css
|
32 |
+
)
|
33 |
+
|
34 |
+
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
transformers
|
3 |
+
gradio
|
4 |
+
sentencepiece
|
5 |
+
torchvision
|
6 |
+
huggingface_hub
|
7 |
+
pillow
|
8 |
+
numpy
|