asad231 commited on
Commit
de87c87
Β·
verified Β·
1 Parent(s): 907d5b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -173,6 +173,8 @@ def detect_deepfake_image(image_path):
173
  # else:
174
  # st.success(f"βœ… Result: This news is **REAL**. (Confidence: {confidence:.2f})")
175
  # ---- Fake News Detection Section ----
 
 
176
  st.subheader("πŸ“ Fake News Detection")
177
  news_input = st.text_area("Enter News Text:", placeholder="Type here...")
178
 
@@ -184,8 +186,8 @@ if st.button("Check News"):
184
  label = prediction[0]['label'].lower()
185
  confidence = prediction[0]['score']
186
 
187
- # Fix classification issue
188
- if label in ["fake", "false", "negative"]:
189
  st.error(f"⚠️ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
190
  else:
191
  st.success(f"βœ… Result: This news is **REAL**. (Confidence: {confidence:.2f})")
 
173
  # else:
174
  # st.success(f"βœ… Result: This news is **REAL**. (Confidence: {confidence:.2f})")
175
  # ---- Fake News Detection Section ----
176
+ import streamlit as st
177
+
178
  st.subheader("πŸ“ Fake News Detection")
179
  news_input = st.text_area("Enter News Text:", placeholder="Type here...")
180
 
 
186
  label = prediction[0]['label'].lower()
187
  confidence = prediction[0]['score']
188
 
189
+ # Ensure proper classification
190
+ if label in ["fake", "false", "negative"] or confidence < 0.7:
191
  st.error(f"⚠️ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
192
  else:
193
  st.success(f"βœ… Result: This news is **REAL**. (Confidence: {confidence:.2f})")