File size: 809 Bytes
850dd49
 
b0bd4fb
4cd7e23
850dd49
 
 
f8dfc8e
 
 
 
 
850dd49
f8dfc8e
 
 
 
 
850dd49
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

def predict(model, input_txt):
    return 0.46  # Worldwide spam rate in 2023. Source: https://securelist.com/spam-phishing-report-2023/112015/

demo = gr.Interface(
    fn=predict,
    inputs=[
        gr.Dropdown(choices=["spam-rate"], label="Model"),
        gr.TextArea(label="Email"),
    ],
    outputs=[gr.Number(label="Spam probability")],
    title="Bayes or Spam?",
    description="Choose your model, and predict if your email is a spam! COMING SOON: Bayesian, NN and LLM models.",
    examples=[
        ["spam-rate", "revision #1 - hpl noms for november 3, 2000 (see attached file: hplnl 103.xls) - hplnl 103.xls"],
    ],
    article="This is a demo of the models in [Bayes or Spam?](https://github.com/tbitai/bayes-or-spam)",
)

if __name__ == "__main__":
    demo.launch()