rbughao commited on
Commit
9c123d3
·
verified ·
1 Parent(s): b8987b5

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+
5
+ def analyze_output(input):
6
+ pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
7
+ x = pipe(input)[0]
8
+ if x["label"] == "LABEL_0":
9
+ return {"type":"Not Spam", "probability":x["score"]}
10
+ else:
11
+ return {"type":"Spam", "probability":x["score"]}
12
+
13
+
14
+ demo = gr.Interface(fn=analyze_output, inputs="text", outputs="text")
15
+ demo.launch()