vickeee465 commited on
Commit
0bade3d
·
1 Parent(s): 40de5cf
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -80,13 +80,13 @@ def prepare_heatmap_data(data):
80
 
81
  heatmap_data = pd.DataFrame(0.0, index=range(len(data)), columns=id2label.values())
82
 
83
- for idx, item in enumerate(data):
84
- print(f"DEBUG: Item at index {idx}: {item} (type: {type(item)})")
85
 
86
- if not isinstance(item, dict):
87
- raise TypeError(f"Expected dict, but got {type(item)} at index {idx}: {item}")
88
 
89
- confidences = item["emotions"].tolist()
90
  for idy, confidence in enumerate(confidences):
91
  emotion = id2label[idy]
92
  heatmap_data.at[idx, emotion] = confidence
 
80
 
81
  heatmap_data = pd.DataFrame(0.0, index=range(len(data)), columns=id2label.values())
82
 
83
+ for idx, row in enumerate(data):
84
+ print(f"DEBUG: Item at index {idx}: {row} (type: {type(row)})")
85
 
86
+ if not isinstance(row, dict):
87
+ raise TypeError(f"Expected dict, but got {type(row)} at index {idx}: {row}")
88
 
89
+ confidences = row["emotions"].tolist()
90
  for idy, confidence in enumerate(confidences):
91
  emotion = id2label[idy]
92
  heatmap_data.at[idx, emotion] = confidence