Commit
·
9759e5c
1
Parent(s):
0df32cd
update syntax string
Browse files
app.py
CHANGED
@@ -129,15 +129,15 @@ def chips_label(output):
|
|
129 |
asd = []
|
130 |
for label in output["predicted_labels"]:
|
131 |
if label == "Product":
|
132 |
-
score = f"{output[
|
133 |
score = f"<strong>{score}</strong>"
|
134 |
asd.append(f"<div class='rounded-label-product'>📦Product {score}</div>")
|
135 |
elif label == "Customer Service":
|
136 |
-
score = f"{output[
|
137 |
score = f"<strong>{score}</strong>"
|
138 |
asd.append(f"<div class='rounded-label-customer-service'>👩💼Customer Service {score}</div>")
|
139 |
elif label == "Shipping/Delivery":
|
140 |
-
score = f"{output[
|
141 |
score = f"<strong>{score}</strong>"
|
142 |
asd.append(f"<div class='rounded-label-shipping-delivery'>🚚Shipping/Delivery {score}</div>")
|
143 |
# for label, score in zip(output["predicted_labels"], output["predicted_score"]):
|
|
|
129 |
asd = []
|
130 |
for label in output["predicted_labels"]:
|
131 |
if label == "Product":
|
132 |
+
score = f"{output['predicted_score'][0] * 100:.2f}%"
|
133 |
score = f"<strong>{score}</strong>"
|
134 |
asd.append(f"<div class='rounded-label-product'>📦Product {score}</div>")
|
135 |
elif label == "Customer Service":
|
136 |
+
score = f"{output['predicted_score'][1] * 100:.2f}%"
|
137 |
score = f"<strong>{score}</strong>"
|
138 |
asd.append(f"<div class='rounded-label-customer-service'>👩💼Customer Service {score}</div>")
|
139 |
elif label == "Shipping/Delivery":
|
140 |
+
score = f"{output['predicted_score'][2] * 100:.2f}%"
|
141 |
score = f"<strong>{score}</strong>"
|
142 |
asd.append(f"<div class='rounded-label-shipping-delivery'>🚚Shipping/Delivery {score}</div>")
|
143 |
# for label, score in zip(output["predicted_labels"], output["predicted_score"]):
|