Update app.py
Browse files
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 |
-
#
|
189 |
-
if
|
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.
|
|
|
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")
|