Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID)
|
|
| 14 |
model.to(DEVICE)
|
| 15 |
model.eval()
|
| 16 |
|
| 17 |
-
LABELS = ["
|
| 18 |
|
| 19 |
# ==============================
|
| 20 |
# 2. Inference Function
|
|
@@ -37,7 +37,7 @@ def classify_sentiment(text):
|
|
| 37 |
pos_p = softmax[1]
|
| 38 |
|
| 39 |
# Predict label
|
| 40 |
-
label = "
|
| 41 |
|
| 42 |
return {
|
| 43 |
"label": label,
|
|
|
|
| 14 |
model.to(DEVICE)
|
| 15 |
model.eval()
|
| 16 |
|
| 17 |
+
LABELS = ["neg", "pos"]
|
| 18 |
|
| 19 |
# ==============================
|
| 20 |
# 2. Inference Function
|
|
|
|
| 37 |
pos_p = softmax[1]
|
| 38 |
|
| 39 |
# Predict label
|
| 40 |
+
label = "neg" if neg_p > pos_p else "pos"
|
| 41 |
|
| 42 |
return {
|
| 43 |
"label": label,
|