Spaces:
Sleeping
Sleeping
vickeee465
commited on
Commit
·
1204574
1
Parent(s):
c275808
rounding for heatmap
Browse files
app.py
CHANGED
@@ -89,7 +89,7 @@ def prepare_heatmap_data(data):
|
|
89 |
confidences = row["emotions"].tolist()
|
90 |
for idy, confidence in enumerate(confidences):
|
91 |
emotion = id2label[idy]
|
92 |
-
heatmap_data.at[idx, emotion] = confidence
|
93 |
|
94 |
heatmap_data.index = [item["sentence"][:18]+"..." for item in data]
|
95 |
return heatmap_data
|
|
|
89 |
confidences = row["emotions"].tolist()
|
90 |
for idy, confidence in enumerate(confidences):
|
91 |
emotion = id2label[idy]
|
92 |
+
heatmap_data.at[idx, emotion] = f"{round(100 * confidence, 2)}%"
|
93 |
|
94 |
heatmap_data.index = [item["sentence"][:18]+"..." for item in data]
|
95 |
return heatmap_data
|