Spaces:
Runtime error
Runtime error
spam_classifer: fix the Interface
Browse filesSigned-off-by: Panchajanya1999 <rsk52959@gmail.com>
- spam_classifier.py +5 -2
spam_classifier.py
CHANGED
@@ -76,10 +76,13 @@ hf_writer = gr.HuggingFaceDatasetSaver(HF_API_TOKEN, "spam-mistakes")
|
|
76 |
iface = gr.Interface(
|
77 |
fn=predict_spam,
|
78 |
inputs=gr.Textbox(lines=2, placeholder="Enter a message to check if it is spam or ham", label="Message", info = "Enter a message"),
|
79 |
-
outputs=gr.Textbox(lines=2, info="Check if the enetered message is spam or ham", label="Prediction", placeholder = "Output will be here.."),
|
80 |
title="Spam Classifier",
|
81 |
description="Enter a message to check if it is spam or ham",
|
82 |
allow_flagging='manual',
|
83 |
flagging_callback=hf_writer,
|
84 |
-
examples=[['Hey, how are you doing?'], ['Congratulations! You have won a free trip to Dubai!']]
|
|
|
|
|
|
|
85 |
iface.launch()
|
|
|
76 |
iface = gr.Interface(
|
77 |
fn=predict_spam,
|
78 |
inputs=gr.Textbox(lines=2, placeholder="Enter a message to check if it is spam or ham", label="Message", info = "Enter a message"),
|
79 |
+
outputs=gr.Textbox(lines=2, info="Check if the enetered message is spam or ham. If the prediction is opposite, please flag it by hitting the Flag button below.", label="Prediction", placeholder = "Output will be here.."),
|
80 |
title="Spam Classifier",
|
81 |
description="Enter a message to check if it is spam or ham",
|
82 |
allow_flagging='manual',
|
83 |
flagging_callback=hf_writer,
|
84 |
+
examples=[['Hey, how are you doing?'], ['Congratulations! You have won a free trip to Dubai!']],
|
85 |
+
theme=gr.themes.Monochrome(),
|
86 |
+
article="<details><summary>How does it work?</summary><p>It uses a Naive Bayes classifier to classify the message as spam or ham. The model is trained on a dataset of 5572 messages. The model is then tested on a test set of 1115 messages. The accuracy of the model is 98.2%.</p></details>"
|
87 |
+
)
|
88 |
iface.launch()
|