Commit
•
0d9b200
1
Parent(s):
4c2bf52
finally corrected the error
Browse files
app.py
CHANGED
@@ -16,10 +16,20 @@ if text is not None:
|
|
16 |
col1.header("Sentiment")
|
17 |
col2.header("Probability")
|
18 |
|
19 |
-
label
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
|
25 |
|
|
|
16 |
col1.header("Sentiment")
|
17 |
col2.header("Probability")
|
18 |
|
19 |
+
for label, probability in zip(predictions[0]["label"], predictions[0]["score"]):
|
20 |
+
if label == "entailment":
|
21 |
+
sentiment = "Negative"
|
22 |
+
elif label == "contradiction":
|
23 |
+
sentiment = "Neutral"
|
24 |
+
else label == "neutral":
|
25 |
+
sentiment = "Positive"
|
26 |
+
|
27 |
+
col1.write(sentiment)
|
28 |
+
col2.write(f"{probability:.2f}")
|
29 |
+
# label = predictions[0]["label"]
|
30 |
+
# probability = predictions[0]["score"]
|
31 |
+
# col1.write(label)
|
32 |
+
# col2.write(f"{probability:.2f}")
|
33 |
|
34 |
|
35 |
|