Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,8 @@ def predict(new_sentence):
|
|
65 |
output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
|
66 |
|
67 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
68 |
-
|
|
|
69 |
|
70 |
#st.write('Input', namestr(new_sentence, globals()),': \n', new_sentence)
|
71 |
# Remove the namestr(new_sentence, globals()) in case of an error
|
|
|
65 |
output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
|
66 |
|
67 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
68 |
+
pred = 'Predicted Class: '+ prediction
|
69 |
+
st.header(pred)
|
70 |
|
71 |
#st.write('Input', namestr(new_sentence, globals()),': \n', new_sentence)
|
72 |
# Remove the namestr(new_sentence, globals()) in case of an error
|