File size: 599 Bytes
2f33e52
 
 
 
 
 
b6c534d
2f33e52
 
 
 
 
b6c534d
2f33e52
 
 
 
 
6d55c24
 
 
 
 
 
2f33e52
6d55c24
 
 
 
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
27
28
29
from test import test_predict
import gradio as gr

def gradio_comment(comment):
    
   
    result = test_predict(comment)[0]

    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}''')

iface = gr.Interface(gradio_comment, "text", "text")

if __name__ == "__main__":
    iface.launch(enable_queue=True)