Spaces:
Sleeping
Sleeping
Commit
·
44fb3a5
1
Parent(s):
e3d4a3e
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,14 +4,14 @@ 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.
|
| 8 |
result=mp.predict(input_Email_conv)
|
| 9 |
if(result[0]==1):
|
| 10 |
final_result="HAM"
|
| 11 |
return final_result
|
| 12 |
elif(result[0]==0):
|
| 13 |
final_result="SPAM"
|
| 14 |
-
|
| 15 |
|
| 16 |
|
| 17 |
interface=gr.Interface(fn=Mail_Prediction,inputs=[gr.inputs.Textbox(lines=2,placeholder="Enter your Email",label="Spam Email Checker")],
|
|
|
|
| 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])
|
| 8 |
result=mp.predict(input_Email_conv)
|
| 9 |
if(result[0]==1):
|
| 10 |
final_result="HAM"
|
| 11 |
return final_result
|
| 12 |
elif(result[0]==0):
|
| 13 |
final_result="SPAM"
|
| 14 |
+
return final_result
|
| 15 |
|
| 16 |
|
| 17 |
interface=gr.Interface(fn=Mail_Prediction,inputs=[gr.inputs.Textbox(lines=2,placeholder="Enter your Email",label="Spam Email Checker")],
|