AhmedBou commited on
Commit
9527187
·
verified ·
1 Parent(s): 134e79e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -1,13 +1,7 @@
1
  import gradio as gr
2
 
3
- def classify_job_description(text):
4
- import transformers
5
- from transformers import pipeline
6
-
7
- nlp = pipeline("text-classification", model="your_model_name")
8
- result = nlp(text)
9
- # Process the result to extract labels and confidences
10
- return result
11
 
12
  # Define the title and text labels
13
  title = "Classify Job Descriptions at the Span Level"
@@ -21,6 +15,9 @@ label_texts = {
21
  }
22
 
23
  # Create the Gradio interface
 
 
 
24
  interface = gr.Interface(
25
  fn=classify_job_description,
26
  inputs=gr.components.Textbox(lines=10, placeholder="Enter job description here..."),
 
1
  import gradio as gr
2
 
3
+ # Load the model
4
+ model = gr.load("models/AhmedBou/JoBert")
 
 
 
 
 
 
5
 
6
  # Define the title and text labels
7
  title = "Classify Job Descriptions at the Span Level"
 
15
  }
16
 
17
  # Create the Gradio interface
18
+ def classify_job_description(text):
19
+ return model(text)
20
+
21
  interface = gr.Interface(
22
  fn=classify_job_description,
23
  inputs=gr.components.Textbox(lines=10, placeholder="Enter job description here..."),