Update app.py
Browse files
app.py
CHANGED
@@ -970,29 +970,19 @@ def main():
|
|
970 |
st.subheader("Classification Report")
|
971 |
st.text(classification_rep)
|
972 |
|
973 |
-
|
974 |
-
st.error(f"Error evaluating model: {e}")
|
975 |
-
|
976 |
-
# 6️⃣ Classification Report
|
977 |
-
st.subheader("Classification Report")
|
978 |
-
st.text(classification_rep)
|
979 |
-
|
980 |
-
# ✅ Always show bias detection report if possible
|
981 |
-
# Bias Detection Report
|
982 |
st.subheader("Bias Detection Report")
|
983 |
if 'comment_text' in st.session_state.data.columns:
|
984 |
bias_summary = bias_report(
|
985 |
st.session_state.data[["comment_text"]].reset_index(drop=True),
|
986 |
y_test.reset_index(drop=True),
|
987 |
predictions,
|
988 |
-
"comment_text"
|
989 |
)
|
990 |
st.markdown(bias_summary)
|
991 |
else:
|
992 |
st.info("No comment_text column found for bias analysis.")
|
993 |
|
994 |
-
|
995 |
-
|
996 |
except Exception as e:
|
997 |
st.error(f"Error evaluating model: {e}")
|
998 |
else:
|
|
|
970 |
st.subheader("Classification Report")
|
971 |
st.text(classification_rep)
|
972 |
|
973 |
+
# 7️⃣ Bias Detection Report
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
974 |
st.subheader("Bias Detection Report")
|
975 |
if 'comment_text' in st.session_state.data.columns:
|
976 |
bias_summary = bias_report(
|
977 |
st.session_state.data[["comment_text"]].reset_index(drop=True),
|
978 |
y_test.reset_index(drop=True),
|
979 |
predictions,
|
980 |
+
"comment_text"
|
981 |
)
|
982 |
st.markdown(bias_summary)
|
983 |
else:
|
984 |
st.info("No comment_text column found for bias analysis.")
|
985 |
|
|
|
|
|
986 |
except Exception as e:
|
987 |
st.error(f"Error evaluating model: {e}")
|
988 |
else:
|