Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,9 +84,27 @@ if st.button("submit"):
|
|
| 84 |
words=text.split()
|
| 85 |
v=preprocess(words)
|
| 86 |
output=model(v)
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
|
|
|
|
| 84 |
words=text.split()
|
| 85 |
v=preprocess(words)
|
| 86 |
output=model(v)
|
| 87 |
+
|
| 88 |
+
review_status = {
|
| 89 |
+
0: ("✅ Its a Fake news","#FF4500" ), # Green
|
| 90 |
+
1: ("❌ Its not a Fake news ", "#32CD32") # Red-Orange
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
# Get message and color based on prediction
|
| 94 |
+
message, color = review_status.get(output.argmax(), ("❓ Unknown Prediction", "#808080"))
|
| 95 |
+
|
| 96 |
+
# Display styled result
|
| 97 |
+
st.markdown(f"""
|
| 98 |
+
<div style="
|
| 99 |
+
padding: 15px;
|
| 100 |
+
background-color: {color};
|
| 101 |
+
border-radius: 10px;
|
| 102 |
+
text-align: center;
|
| 103 |
+
font-size: 18px;
|
| 104 |
+
font-weight: bold;
|
| 105 |
+
color: white;">
|
| 106 |
+
{message}
|
| 107 |
+
</div>
|
| 108 |
+
""", unsafe_allow_html=True)
|
| 109 |
|
| 110 |
|