Spaces:
Sleeping
Sleeping
Enhance prediction display styling in app.py
Browse files- Add !important declarations to ensure consistent color application
- Improve font family with system fonts for better readability
- Enhance font weights for better visual hierarchy in prediction boxes
- Make text colors more specific and consistent
- Update comments to be more descriptive of styling enhancements
app.py
CHANGED
|
@@ -152,20 +152,30 @@ def classify_feedback(text):
|
|
| 152 |
"""
|
| 153 |
|
| 154 |
for i, (topic, probability) in enumerate(predictions, 1):
|
| 155 |
-
# Add prediction box with fixed color
|
| 156 |
html_output += f"""
|
| 157 |
<div style="
|
| 158 |
-
background-color: #009999;
|
| 159 |
-
color: #ffffff;
|
| 160 |
padding: 15px;
|
| 161 |
border-radius: 8px;
|
| 162 |
margin-bottom: 10px;
|
| 163 |
font-weight: 500;
|
|
|
|
| 164 |
">
|
| 165 |
-
<div style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
{i}. {topic}
|
| 167 |
</div>
|
| 168 |
-
<div style="
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
Confidence: {probability:.1%}
|
| 170 |
</div>
|
| 171 |
</div>
|
|
|
|
| 152 |
"""
|
| 153 |
|
| 154 |
for i, (topic, probability) in enumerate(predictions, 1):
|
| 155 |
+
# Add prediction box with fixed color and enhanced specificity
|
| 156 |
html_output += f"""
|
| 157 |
<div style="
|
| 158 |
+
background-color: #009999 !important;
|
| 159 |
+
color: #ffffff !important;
|
| 160 |
padding: 15px;
|
| 161 |
border-radius: 8px;
|
| 162 |
margin-bottom: 10px;
|
| 163 |
font-weight: 500;
|
| 164 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 165 |
">
|
| 166 |
+
<div style="
|
| 167 |
+
font-size: 16px;
|
| 168 |
+
margin-bottom: 5px;
|
| 169 |
+
color: #ffffff !important;
|
| 170 |
+
font-weight: 600;
|
| 171 |
+
">
|
| 172 |
{i}. {topic}
|
| 173 |
</div>
|
| 174 |
+
<div style="
|
| 175 |
+
font-size: 14px;
|
| 176 |
+
opacity: 0.9;
|
| 177 |
+
color: #ffffff !important;
|
| 178 |
+
">
|
| 179 |
Confidence: {probability:.1%}
|
| 180 |
</div>
|
| 181 |
</div>
|