Negativ / app.py
danagyl's picture
Create app.py
a71644c verified
raw
history blame contribute delete
354 Bytes
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()