Spaces:
Sleeping
Sleeping
vickeee465
commited on
Commit
·
967f2ec
1
Parent(s):
d0ea323
it's a numpy list
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ def prepare_heatmap_data(data):
|
|
| 77 |
heatmap_data = pd.DataFrame(0, index=range(len(data)), columns=id2label.values())
|
| 78 |
for idx, item in enumerate(data):
|
| 79 |
print(item) # DEBUG
|
| 80 |
-
for idy, confidence in enumerate(item["emotions"]):
|
| 81 |
emotion = id2label[idy]
|
| 82 |
heatmap_data.at[idx, emotion] = confidence
|
| 83 |
heatmap_data.index = [item["sentence"] for item in data]
|
|
|
|
| 77 |
heatmap_data = pd.DataFrame(0, index=range(len(data)), columns=id2label.values())
|
| 78 |
for idx, item in enumerate(data):
|
| 79 |
print(item) # DEBUG
|
| 80 |
+
for idy, confidence in enumerate(item["emotions"].tolist()): # it's a numpy array...
|
| 81 |
emotion = id2label[idy]
|
| 82 |
heatmap_data.at[idx, emotion] = confidence
|
| 83 |
heatmap_data.index = [item["sentence"] for item in data]
|