Update app.py
Browse files
app.py
CHANGED
@@ -173,8 +173,6 @@ 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 |
-
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,12 +184,13 @@ if st.button("Check News"):
|
|
186 |
label = prediction[0]['label'].lower()
|
187 |
confidence = prediction[0]['score']
|
188 |
|
189 |
-
# Ensure
|
190 |
-
if label in ["
|
|
|
|
|
191 |
st.error(f"โ ๏ธ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
|
192 |
else:
|
193 |
-
st.
|
194 |
-
|
195 |
# ---- Deepfake Image Detection Section ----
|
196 |
st.subheader("๐ธ Deepfake Image Detection")
|
197 |
uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
|
|
|
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 |
label = prediction[0]['label'].lower()
|
185 |
confidence = prediction[0]['score']
|
186 |
|
187 |
+
# Ensure correct classification
|
188 |
+
if confidence > 0.75 and label in ["real", "true", "positive"]:
|
189 |
+
st.success(f"โ
Result: This news is **REAL**. (Confidence: {confidence:.2f})")
|
190 |
+
elif confidence < 0.5 or label in ["fake", "false", "negative"]:
|
191 |
st.error(f"โ ๏ธ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
|
192 |
else:
|
193 |
+
st.warning(f"โ ๏ธ Unable to classify with high confidence. Please verify manually. (Confidence: {confidence:.2f})")
|
|
|
194 |
# ---- Deepfake Image Detection Section ----
|
195 |
st.subheader("๐ธ Deepfake Image Detection")
|
196 |
uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
|