brendabor commited on
Commit
f47cfde
1 Parent(s): 85af53b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -64,6 +64,10 @@ knn_recs = recommend_knn(song_index_to_recommend)
64
 
65
  # Display the predicted emotion and recommendations
66
  st.write(f"Predicted Emotion: {emotion}")
67
- st.write("KNN Recommendations:")
68
- for index in knn_recs.index:
69
- st.write(f"Song Index: {index}, Title: {df.iloc[index]['title']}, Artist: {df.iloc[index]['artist']}, Score: {knn_recs.loc[index, 'score']}")
 
 
 
 
 
64
 
65
  # Display the predicted emotion and recommendations
66
  st.write(f"Predicted Emotion: {emotion}")
67
+
68
+ if not knn_recs.empty:
69
+ st.write("KNN Recommendations:")
70
+ for index, row in knn_recs.iterrows():
71
+ st.write(f"Song Index: {index}, Title: {row['title']}, Artist: {row['artist']}, Score: {row['score']}")
72
+ else:
73
+ st.write("No KNN Recommendations found."