Spaces:
Sleeping
Sleeping
Commit ·
5bd3ef0
1
Parent(s): 5d9deaa
Auto-add 'Other' catch-all on classify instead of warning user
Browse files
app.py
CHANGED
|
@@ -1731,12 +1731,7 @@ with col_input:
|
|
| 1731 |
st.rerun()
|
| 1732 |
|
| 1733 |
if categories_entered and has_other_category and not has_other_category(categories_entered):
|
| 1734 |
-
st.
|
| 1735 |
-
"No catch-all category detected. Responses that don't fit your categories "
|
| 1736 |
-
"will still be forced into one. Consider adding **\"Other\"** or "
|
| 1737 |
-
"**\"None of the above\"**.",
|
| 1738 |
-
icon="⚠️",
|
| 1739 |
-
)
|
| 1740 |
|
| 1741 |
# Verbosity check results — only show if it matches the current categories.
|
| 1742 |
vc = st.session_state.verbosity_check
|
|
@@ -1771,6 +1766,11 @@ with col_input:
|
|
| 1771 |
elif classify_mode == "Ensemble" and len(models_list) < 3:
|
| 1772 |
st.error("Please select at least 3 models for ensemble mode (needed for majority voting)")
|
| 1773 |
else:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1774 |
# Set up progress tracking
|
| 1775 |
mode = None
|
| 1776 |
if input_type_selected == "pdf":
|
|
|
|
| 1731 |
st.rerun()
|
| 1732 |
|
| 1733 |
if categories_entered and has_other_category and not has_other_category(categories_entered):
|
| 1734 |
+
st.caption("An **\"Other\"** catch-all category will be added automatically when you classify.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1735 |
|
| 1736 |
# Verbosity check results — only show if it matches the current categories.
|
| 1737 |
vc = st.session_state.verbosity_check
|
|
|
|
| 1766 |
elif classify_mode == "Ensemble" and len(models_list) < 3:
|
| 1767 |
st.error("Please select at least 3 models for ensemble mode (needed for majority voting)")
|
| 1768 |
else:
|
| 1769 |
+
# Auto-append "Other" catch-all if the user didn't include one,
|
| 1770 |
+
# so responses that don't fit are captured rather than force-fit.
|
| 1771 |
+
if has_other_category and not has_other_category(categories_entered):
|
| 1772 |
+
categories_entered.append("Other")
|
| 1773 |
+
|
| 1774 |
# Set up progress tracking
|
| 1775 |
mode = None
|
| 1776 |
if input_type_selected == "pdf":
|