rbughao commited on
Commit
21b325f
1 Parent(s): 885a61e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -1,13 +1,16 @@
1
- from transformers import pipeline
 
2
 
3
 
4
- def analyze_output(input: str):
5
- pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
 
6
  x = pipe(input)[0]
7
  if x["label"] == "LABEL_0":
8
  return {"type":"Not Spam", "probability":x["score"]}
9
  else:
10
  return {"type":"Spam", "probability":x["score"]}
11
-
12
 
13
- print(analyze_output("Cһeck out our amazinɡ bооѕting serviсe ѡhere you can get to Leveӏ 3 for 3 montһs for just 20 USD."))
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline, AutoModelForTokenClassification, AutoTokenizer
3
 
4
 
5
+ def analyze_output(input):
6
+ pipe = pipeline("text-classification", model='Titeiiko/OTIS-Official-Spam-Model')
7
+ return "hello"
8
  x = pipe(input)[0]
9
  if x["label"] == "LABEL_0":
10
  return {"type":"Not Spam", "probability":x["score"]}
11
  else:
12
  return {"type":"Spam", "probability":x["score"]}
 
13
 
14
+
15
+ demo = gr.Interface(fn=analyze_output, inputs="text", outputs="text")
16
+ demo.launch()