asad231 commited on
Commit
439dedf
·
verified ·
1 Parent(s): 6b123b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -185,13 +185,12 @@ if st.button("Check News"):
185
  label = prediction[0]['label'].lower()
186
  confidence = prediction[0]['score']
187
 
188
- # Fix classification issue
189
- if confidence > 0.6 and label in ["real", "true", "positive"]:
190
- st.success(f"✅ Result: This news is **REAL**. (Confidence: {confidence:.2f})")
191
- elif confidence < 0.4 or label in ["fake", "false", "negative"]:
192
  st.error(f"⚠️ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
193
  else:
194
- st.warning(f"⚠️ Unable to classify with high confidence. Please verify manually. (Confidence: {confidence:.2f})")
 
195
 
196
  # ---- Deepfake Image Detection Section ----
197
  st.subheader("📸 Deepfake Image Detection")
 
185
  label = prediction[0]['label'].lower()
186
  confidence = prediction[0]['score']
187
 
188
+ # Ensure proper classification
189
+ if label in ["fake", "false", "negative"] or confidence < 0.5:
 
 
190
  st.error(f"⚠️ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
191
  else:
192
+ st.success(f" Result: This news is **REAL**. (Confidence: {confidence:.2f})")
193
+
194
 
195
  # ---- Deepfake Image Detection Section ----
196
  st.subheader("📸 Deepfake Image Detection")