Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,32 @@
|
|
1 |
from transformers import pipeline
|
2 |
-
|
3 |
|
4 |
-
# Load a
|
|
|
5 |
classifier = pipeline("text-classification", model="nlptown/bert-base-multilingual-uncased-sentiment")
|
6 |
|
7 |
def match_profile(resume_text, linkedin_text):
|
|
|
|
|
|
|
|
|
8 |
input_text = resume_text + " " + linkedin_text
|
9 |
result = classifier(input_text)
|
|
|
10 |
score = result[0]['score'] * 100
|
11 |
-
return f"
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
|
|
|
|
1 |
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
|
4 |
+
# Load a pre-trained sentiment analysis model for demo purposes
|
5 |
+
# You can replace this with your fine-tuned model later
|
6 |
classifier = pipeline("text-classification", model="nlptown/bert-base-multilingual-uncased-sentiment")
|
7 |
|
8 |
def match_profile(resume_text, linkedin_text):
|
9 |
+
"""
|
10 |
+
Combines resume and LinkedIn text, sends to classifier,
|
11 |
+
and returns a Suitability Score (0-100).
|
12 |
+
"""
|
13 |
input_text = resume_text + " " + linkedin_text
|
14 |
result = classifier(input_text)
|
15 |
+
label = result[0]['label']
|
16 |
score = result[0]['score'] * 100
|
17 |
+
return f"Predicted Label: {label}\nSuitability Score: {score:.2f}"
|
18 |
|
19 |
+
# Gradio Interface
|
20 |
+
interface = gr.Interface(
|
21 |
+
fn=match_profile,
|
22 |
+
inputs=[
|
23 |
+
gr.Textbox(lines=10, placeholder="Paste Resume Text here...", label="Resume Text"),
|
24 |
+
gr.Textbox(lines=5, placeholder="Paste LinkedIn Profile Summary here...", label="LinkedIn Text")
|
25 |
+
],
|
26 |
+
outputs="text",
|
27 |
+
title="LIC Profile Matcher",
|
28 |
+
description="This tool matches an agent’s resume and LinkedIn profile using a BERT model and returns a suitability score."
|
29 |
+
)
|
30 |
|
31 |
+
# Launch the app
|
32 |
+
interface.launch()
|