File size: 354 Bytes
a71644c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
import Negativ.PythonCode.__init__ as pc

msg_deleted = "--This Toxic Comment Has Been Deleted--"

print(dir(pc))

def predict_toxicity(sentence):
    
    if pc.is_toxic(sentence):
        return msg_deleted
    
    else:
        return sentence

demo = gr.Interface(fn=predict_toxicity, inputs="text", outputs="text")
demo.launch()