Update app.py
Browse files
app.py
CHANGED
|
@@ -189,9 +189,9 @@ class CourseRecommendationWebApp:
|
|
| 189 |
|
| 190 |
result_text += f"\n**📝 Description:**\n{course.get('Description', 'N/A')}\n\n"
|
| 191 |
|
| 192 |
-
# Behavioral breakdown for top
|
| 193 |
-
if
|
| 194 |
-
|
| 195 |
result_text += f"**🧠 Detailed Behavioral Analysis:**\n"
|
| 196 |
|
| 197 |
metrics_info = [
|
|
@@ -203,8 +203,8 @@ class CourseRecommendationWebApp:
|
|
| 203 |
]
|
| 204 |
|
| 205 |
for name, key, description in metrics_info:
|
| 206 |
-
if key in behavioral_metrics and
|
| 207 |
-
score = behavioral_metrics[key][
|
| 208 |
result_text += f"- **{name}:** {score:.1f}% - {description}\n"
|
| 209 |
|
| 210 |
result_text += "\n---\n\n"
|
|
|
|
| 189 |
|
| 190 |
result_text += f"\n**📝 Description:**\n{course.get('Description', 'N/A')}\n\n"
|
| 191 |
|
| 192 |
+
# Behavioral breakdown for ALL recommendations (not just top 1)
|
| 193 |
+
if recommendations and behavioral_metrics:
|
| 194 |
+
rec_idx = rec.get('index', 0)
|
| 195 |
result_text += f"**🧠 Detailed Behavioral Analysis:**\n"
|
| 196 |
|
| 197 |
metrics_info = [
|
|
|
|
| 203 |
]
|
| 204 |
|
| 205 |
for name, key, description in metrics_info:
|
| 206 |
+
if key in behavioral_metrics and rec_idx < len(behavioral_metrics[key]):
|
| 207 |
+
score = behavioral_metrics[key][rec_idx]
|
| 208 |
result_text += f"- **{name}:** {score:.1f}% - {description}\n"
|
| 209 |
|
| 210 |
result_text += "\n---\n\n"
|