Spaces:
Runtime error
Runtime error
from transformers import pipeline | |
import gradio as gr | |
# Load model (demo sentiment classifier — replace with your own model later) | |
classifier = pipeline("text-classification", model="nlptown/bert-base-multilingual-uncased-sentiment") | |
# Define function to process input and return score | |
def match_profile(resume_text, linkedin_text): | |
try: | |
input_text = (resume_text + " " + linkedin_text)[:1000] # limit length | |
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)}" | |
# Define Gradio interface | |
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." | |
) | |
# Launch WITHOUT the share button | |
interface.launch(share=False) # 👈 No Share via Link button |