Spaces:
Sleeping
Sleeping
vickeee465
commited on
Commit
·
3fc45cd
1
Parent(s):
967f2ec
???
Browse files
app.py
CHANGED
|
@@ -77,7 +77,9 @@ 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 |
-
|
|
|
|
|
|
|
| 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 |
+
confidences = item["emotions"].tolist()
|
| 81 |
+
print(confidences)
|
| 82 |
+
for idy, confidence in enumerate(confidences): # it's a numpy array...
|
| 83 |
emotion = id2label[idy]
|
| 84 |
heatmap_data.at[idx, emotion] = confidence
|
| 85 |
heatmap_data.index = [item["sentence"] for item in data]
|