Mummia-99 commited on
Commit
8dcd59c
·
verified ·
1 Parent(s): 98110b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -4
app.py CHANGED
@@ -84,9 +84,27 @@ if st.button("submit"):
84
  words=text.split()
85
  v=preprocess(words)
86
  output=model(v)
87
- if output.argmax()==0:
88
- st.write("Its a Fake news")
89
- else:
90
- st.write("Its not a Fake news")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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