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