Update app.py
Browse files
app.py
CHANGED
@@ -51,12 +51,12 @@ def preprocessing(input_text, tokenizer):
|
|
51 |
output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
|
52 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
53 |
pred = 'Predicted Class: '+ prediction
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
|
61 |
|
62 |
|
|
|
51 |
output = model(test_ids.to(device), token_type_ids = None, attention_mask = test_attention_mask.to(device))
|
52 |
prediction = 'Spam' if np.argmax(output.logits.cpu().numpy()).flatten().item() == 1 else 'Normal'
|
53 |
pred = 'Predicted Class: '+ prediction
|
54 |
+
return pred
|
55 |
+
if text or aButton:
|
56 |
+
st.text_input("Enter the text you'd like to analyze for spam.")
|
57 |
+
st.button('Analyze')
|
58 |
+
with col2:
|
59 |
+
st.header(predict(text))
|
60 |
|
61 |
|
62 |
|