Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,14 +5,14 @@ def analyze_output(input_text):
|
|
5 |
pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
|
6 |
result = pipe(input_text)[0]
|
7 |
if result["label"] == "LABEL_0":
|
8 |
-
return
|
9 |
else:
|
10 |
-
return
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
fn=analyze_output,
|
14 |
inputs=gr.Textbox(),
|
15 |
-
outputs=
|
16 |
live=False,
|
17 |
title="Spam Classification App",
|
18 |
description="Enter a text to classify it as Spam or Not Spam.",
|
|
|
5 |
pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
|
6 |
result = pipe(input_text)[0]
|
7 |
if result["label"] == "LABEL_0":
|
8 |
+
return f"Not Spam: {result['score']:.4f}"
|
9 |
else:
|
10 |
+
return f"Spam: {result['score']:.4f}"
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
fn=analyze_output,
|
14 |
inputs=gr.Textbox(),
|
15 |
+
outputs="text",
|
16 |
live=False,
|
17 |
title="Spam Classification App",
|
18 |
description="Enter a text to classify it as Spam or Not Spam.",
|