Spaces:
Sleeping
Sleeping
Commit
·
3bb52d2
1
Parent(s):
ab283c5
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
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=1)
|
| 6 |
+
def Mail_Prediction(Email):
|
| 7 |
+
input_Email_conv=feature_extraction.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
|