Spaces:
Sleeping
Sleeping
Commit ·
3f45e86
1
Parent(s): 44fb3a5
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,9 @@ import pickle
|
|
| 2 |
import gradio as gr
|
| 3 |
from sklearn.feature_extraction.text import TfidfVectorizer
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
feature_extraction=TfidfVectorizer(min_df=1,stop_words='english',lowercase=True)
|
| 6 |
def Mail_Prediction(Email):
|
| 7 |
input_Email_conv=feature_extraction.fit_transform([Email])
|
|
@@ -10,8 +13,8 @@ def Mail_Prediction(Email):
|
|
| 10 |
final_result="HAM"
|
| 11 |
return final_result
|
| 12 |
elif(result[0]==0):
|
| 13 |
-
|
| 14 |
-
|
| 15 |
|
| 16 |
|
| 17 |
interface=gr.Interface(fn=Mail_Prediction,inputs=[gr.inputs.Textbox(lines=2,placeholder="Enter your Email",label="Spam Email Checker")],
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from sklearn.feature_extraction.text import TfidfVectorizer
|
| 4 |
|
| 5 |
+
with open("Mail_Pickle","rb") as f:
|
| 6 |
+
mp=pickle.load(f)
|
| 7 |
+
|
| 8 |
feature_extraction=TfidfVectorizer(min_df=1,stop_words='english',lowercase=True)
|
| 9 |
def Mail_Prediction(Email):
|
| 10 |
input_Email_conv=feature_extraction.fit_transform([Email])
|
|
|
|
| 13 |
final_result="HAM"
|
| 14 |
return final_result
|
| 15 |
elif(result[0]==0):
|
| 16 |
+
final_result="SPAM"
|
| 17 |
+
return final_result
|
| 18 |
|
| 19 |
|
| 20 |
interface=gr.Interface(fn=Mail_Prediction,inputs=[gr.inputs.Textbox(lines=2,placeholder="Enter your Email",label="Spam Email Checker")],
|