import gradio as gr def predict(model="spam-rate", 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()