File size: 591 Bytes
61d03da
 
 
 
bb5b265
61d03da
 
34aed82
61d03da
34aed82
61d03da
 
 
 
34aed82
1458121
61d03da
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import gradio as gr
from transformers import pipeline

def analyze_output(input_text):
    pipe = pipeline("text-classification", model="ZachBeesley/Spam-Detector")
    result = pipe(input_text)[0]
    if result["label"] == "LABEL_0":
        return f"Not Spam: {result['score']:.4f}"
    else:
        return f"Spam: {result['score']:.4f}"

iface = gr.Interface(
    fn=analyze_output,
    inputs=gr.Textbox(),
    outputs="text",
    live=False,
    title="Spam Classification App",
    description="Enter a text to classify it as Spam or Not Spam.",
    theme="compact"
)

iface.launch()