File size: 486 Bytes
2f33e52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from test import test_predict
import gradio as gr

def gradio_comment(comment):
    
   
    result = test_predict(comment)

    if result == 'OTHER':
        text = "NOT OFFENSİVE-OTHER"

    else:
        text = f"OFFENSİVE/{result}"
    
    

    return text

GradioGUI = gr.Interface(
    fn=gradio_comment,
    inputs='text',
    outputs='text',
    title='Aşağılayıcı Yorum Tespiti',
    css='''span{text-transform: uppercase} p{text-align: center}''')

GradioGUI.launch()