Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,11 +3,11 @@ from transformers import pipeline
|
|
3 |
|
4 |
def analyze_output(input_text):
|
5 |
pipe = pipeline("text-classification", model="Titeiiko/OTIS-Official-Spam-Model")
|
6 |
-
|
7 |
-
if
|
8 |
-
return
|
9 |
else:
|
10 |
-
return
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
fn=analyze_output,
|
|
|
3 |
|
4 |
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 f"Not Spam: {result['score']:.4f}"
|
9 |
else:
|
10 |
+
return f"Spam: {result['score']:.4f}"
|
11 |
|
12 |
iface = gr.Interface(
|
13 |
fn=analyze_output,
|