Update app.py
Browse files
app.py
CHANGED
@@ -70,11 +70,10 @@ def predict(new_sentence):
|
|
70 |
output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
|
71 |
|
72 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
73 |
-
|
74 |
|
75 |
-
st.write('Input', namestr(new_sentence, globals()),': \n', new_sentence)
|
76 |
# Remove the namestr(new_sentence, globals()) in case of an error
|
77 |
-
st.write('Predicted Class: ', prediction,'\n----------------------------------\n')
|
78 |
if st.button('Analyze'):
|
79 |
predict(text)
|
80 |
|
|
|
70 |
output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
|
71 |
|
72 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
73 |
+
st.write('Predicted Class: ', prediction)
|
74 |
|
75 |
+
#st.write('Input', namestr(new_sentence, globals()),': \n', new_sentence)
|
76 |
# Remove the namestr(new_sentence, globals()) in case of an error
|
|
|
77 |
if st.button('Analyze'):
|
78 |
predict(text)
|
79 |
|