Spaces:
Sleeping
Sleeping
More descriptive interface elements
Browse files
app.py
CHANGED
@@ -1,13 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def predict(input_txt):
|
4 |
return 0.46 # Worldwide spam rate in 2023. Source: https://securelist.com/spam-phishing-report-2023/112015/
|
5 |
|
6 |
demo = gr.Interface(
|
7 |
fn=predict,
|
8 |
-
inputs=[
|
9 |
-
|
|
|
|
|
|
|
10 |
title="Bayes or Spam?",
|
|
|
|
|
|
|
|
|
|
|
11 |
)
|
12 |
|
13 |
if __name__ == "__main__":
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def predict(model="spam-rate", input_txt):
|
4 |
return 0.46 # Worldwide spam rate in 2023. Source: https://securelist.com/spam-phishing-report-2023/112015/
|
5 |
|
6 |
demo = gr.Interface(
|
7 |
fn=predict,
|
8 |
+
inputs=[
|
9 |
+
gr.Dropdown(choices=["spam-rate"], label="Model"),
|
10 |
+
gr.TextArea(label="Email"),
|
11 |
+
],
|
12 |
+
outputs=[gr.Number(label="Spam probability")],
|
13 |
title="Bayes or Spam?",
|
14 |
+
description="Choose your model, and predict if your email is a spam! COMING SOON: Bayesian, NN and LLM models.",
|
15 |
+
examples=[
|
16 |
+
["spam-rate", "revision #1 - hpl noms for november 3, 2000 (see attached file: hplnl 103.xls) - hplnl 103.xls"],
|
17 |
+
],
|
18 |
+
article="This is a demo of the models in [Bayes or Spam?](https://github.com/tbitai/bayes-or-spam)",
|
19 |
)
|
20 |
|
21 |
if __name__ == "__main__":
|