Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,30 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
8 |
+
label_texts = {
|
9 |
+
"Label_0": "About the Company:",
|
10 |
+
"Label_1": "Job Description:",
|
11 |
+
"Label_2": "Job Requirements:",
|
12 |
+
"Label_3": "Responsibilities:",
|
13 |
+
"Label_4": "Benefits:",
|
14 |
+
"Label_5": "Other:"
|
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.inputs.Textbox(lines=10, placeholder="Enter job description here..."),
|
24 |
+
outputs=gr.outputs.Textbox(label="Classification Results"),
|
25 |
+
title=title,
|
26 |
+
description="\n".join([f"{key}: {value}" for key, value in label_texts.items()])
|
27 |
+
)
|
28 |
+
|
29 |
+
# Launch the interface
|
30 |
+
interface.launch()
|