LvMAC commited on
Commit
a166a35
·
verified ·
1 Parent(s): 4ba7040

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
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 recommendation
193
- if i == 1 and recommendations and behavioral_metrics:
194
- best_idx = rec.get('index', 0)
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 best_idx < len(behavioral_metrics[key]):
207
- score = behavioral_metrics[key][best_idx]
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"