Spaces:
Running
Running
Deploy Streamlit Space app
Browse files
app.py
CHANGED
|
@@ -1667,8 +1667,29 @@ with tab_task5:
|
|
| 1667 |
|
| 1668 |
if freq_table:
|
| 1669 |
st.markdown("#### Bias Pattern Frequency")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1670 |
st.dataframe(
|
| 1671 |
-
|
| 1672 |
use_container_width=True,
|
| 1673 |
)
|
| 1674 |
|
|
|
|
| 1667 |
|
| 1668 |
if freq_table:
|
| 1669 |
st.markdown("#### Bias Pattern Frequency")
|
| 1670 |
+
freq_rows = []
|
| 1671 |
+
for pattern, value in freq_table.items():
|
| 1672 |
+
if isinstance(value, dict):
|
| 1673 |
+
for sub_pattern, sub_value in value.items():
|
| 1674 |
+
try:
|
| 1675 |
+
count_val = float(sub_value)
|
| 1676 |
+
except (TypeError, ValueError):
|
| 1677 |
+
count_val = 0.0
|
| 1678 |
+
freq_rows.append(
|
| 1679 |
+
{
|
| 1680 |
+
"pattern": f"{pattern}::{sub_pattern}",
|
| 1681 |
+
"count": count_val,
|
| 1682 |
+
}
|
| 1683 |
+
)
|
| 1684 |
+
else:
|
| 1685 |
+
try:
|
| 1686 |
+
count_val = float(value)
|
| 1687 |
+
except (TypeError, ValueError):
|
| 1688 |
+
count_val = 0.0
|
| 1689 |
+
freq_rows.append({"pattern": str(pattern), "count": count_val})
|
| 1690 |
+
|
| 1691 |
st.dataframe(
|
| 1692 |
+
sorted(freq_rows, key=lambda row: row["count"], reverse=True),
|
| 1693 |
use_container_width=True,
|
| 1694 |
)
|
| 1695 |
|