sanjaybhargavneela1929 commited on
Commit
8f56da4
·
verified ·
1 Parent(s): cf89fe2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -8
app.py CHANGED
@@ -1,18 +1,32 @@
1
  from transformers import pipeline
2
- from gradio import Interface
3
 
4
- # Load a simple text classification model
 
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"Suitability Score: {score:.2f}"
12
 
13
- iface = Interface(fn=match_profile,
14
- inputs=["text", "text"],
15
- outputs="text",
16
- title="LIC Profile Matcher")
 
 
 
 
 
 
 
17
 
18
- iface.launch()
 
 
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()