File size: 1,071 Bytes
2086a2f
8f56da4
2086a2f
 
 
 
e79685f
 
 
 
 
 
 
 
 
2086a2f
8f56da4
 
 
 
 
 
 
 
 
 
2086a2f
8f56da4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()