emirkocak commited on
Commit
2f33e52
1 Parent(s): 6275761

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from test import test_predict
2
+ import gradio as gr
3
+
4
+ def gradio_comment(comment):
5
+
6
+
7
+ result = test_predict(comment)
8
+
9
+ if result == 'OTHER':
10
+ text = "NOT OFFENSİVE-OTHER"
11
+
12
+ else:
13
+ text = f"OFFENSİVE/{result}"
14
+
15
+
16
+
17
+ return text
18
+
19
+ GradioGUI = gr.Interface(
20
+ fn=gradio_comment,
21
+ inputs='text',
22
+ outputs='text',
23
+ title='Aşağılayıcı Yorum Tespiti',
24
+ css='''span{text-transform: uppercase} p{text-align: center}''')
25
+
26
+ GradioGUI.launch()