Spaces:
Runtime error
Runtime error
from transformers import pipeline | |
import gradio as gr | |
classifier = pipeline("text-classification", model="nlptown/bert-base-multilingual-uncased-sentiment") | |
def match_profile(resume_text, linkedin_text): | |
try: | |
# Combine input safely and truncate | |
input_text = (resume_text + " " + linkedin_text)[:1000] # Trim to 1000 chars | |
result = classifier(input_text) | |
label = result[0]['label'] | |
score = result[0]['score'] * 100 | |
return f"Predicted Label: {label}\nSuitability Score: {score:.2f}" | |
except Exception as e: | |
return f"❌ Error: {str(e)}" | |
interface = gr.Interface( | |
fn=match_profile, | |
inputs=[ | |
gr.Textbox(lines=10, placeholder="Paste Resume Text here...", label="Resume Text"), | |
gr.Textbox(lines=5, placeholder="Paste LinkedIn Profile Summary here...", label="LinkedIn Text") | |
], | |
outputs="text", | |
title="LIC Profile Matcher", | |
description="This tool matches an agent’s resume and LinkedIn profile using a BERT model and returns a suitability score." | |
) | |
interface.launch() | |