Spaces:
Running
Running
vishal2023
commited on
Commit
·
88b31b9
1
Parent(s):
293e8c8
Update app.py
Browse files
app.py
CHANGED
@@ -19,11 +19,11 @@ def predict_NB(text):
|
|
19 |
ps = PorterStemmer()
|
20 |
text = ' '.join([ps.stem(word) for word in text.split()])
|
21 |
X = tfidf.transform([text]).toarray()
|
22 |
-
return 'spam' if model.predict(X)[0] == 1 else
|
23 |
|
24 |
def predict_PIPE(text):
|
25 |
result = pipe(text)[0]
|
26 |
-
return f'''{'spam' if result['label']=='LABEL_1' else
|
27 |
confidence : {result['score']}'''
|
28 |
|
29 |
def fn(model_choice, input):
|
|
|
19 |
ps = PorterStemmer()
|
20 |
text = ' '.join([ps.stem(word) for word in text.split()])
|
21 |
X = tfidf.transform([text]).toarray()
|
22 |
+
return 'spam' if model.predict(X)[0] == 1 else 'not_spam'
|
23 |
|
24 |
def predict_PIPE(text):
|
25 |
result = pipe(text)[0]
|
26 |
+
return f'''{'spam' if result['label']=='LABEL_1' else 'not_spam'}
|
27 |
confidence : {result['score']}'''
|
28 |
|
29 |
def fn(model_choice, input):
|