Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,16 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
|
4 |
-
def analyze_output(input
|
5 |
-
pipe = pipeline("text-classification", 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 |
-
|
|
|
|
|
|
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()
|