77abib commited on
Commit
eafc741
·
verified ·
1 Parent(s): f7eee4e

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ classifier = pipeline(
5
+ "text-classification",
6
+ model="77abib/sarcasm"
7
+ )
8
+
9
+ def predict(text):
10
+
11
+ result = classifier(text)
12
+
13
+ return result
14
+
15
+ demo = gr.Interface(
16
+ fn=predict,
17
+ inputs=gr.Textbox(
18
+ placeholder="اكتب جملة بالعربية..."
19
+ ),
20
+ outputs="json",
21
+ title="Arabic Sarcasm Detector"
22
+ )
23
+
24
+ demo.launch()