danagyl commited on
Commit
a71644c
·
verified ·
1 Parent(s): dcabb04

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import Negativ.PythonCode.__init__ as pc
3
+
4
+ msg_deleted = "--This Toxic Comment Has Been Deleted--"
5
+
6
+ print(dir(pc))
7
+
8
+ def predict_toxicity(sentence):
9
+
10
+ if pc.is_toxic(sentence):
11
+ return msg_deleted
12
+
13
+ else:
14
+ return sentence
15
+
16
+ demo = gr.Interface(fn=predict_toxicity, inputs="text", outputs="text")
17
+ demo.launch()