Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,13 @@ import gradio as gr
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
def analyze_output(input_text):
|
5 |
-
pipe = pipeline("text-classification", model="
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
8 |
iface = gr.Interface(
|
9 |
fn=analyze_output,
|
10 |
inputs=gr.Textbox(),
|
|
|
2 |
from transformers import pipeline
|
3 |
|
4 |
def analyze_output(input_text):
|
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 |
iface = gr.Interface(
|
13 |
fn=analyze_output,
|
14 |
inputs=gr.Textbox(),
|