Sourbh510 commited on
Commit
9fdcc2c
·
verified ·
1 Parent(s): 7d52064

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -9,11 +9,12 @@ def predict(text):
9
  return "⚠️ Please enter a review.", "", 0
10
 
11
  result = classifier(text)[0]
12
- label = result["label"]
13
  score = round(result["score"], 4)
14
 
15
  # Map labels properly
16
- if label == "LABEL_1":
 
17
  sentiment = "Positive"
18
  emoji = "😊"
19
  else:
 
9
  return "⚠️ Please enter a review.", "", 0
10
 
11
  result = classifier(text)[0]
12
+ label = result["label"].upper()
13
  score = round(result["score"], 4)
14
 
15
  # Map labels properly
16
+
17
+ if label in ["POSITIVE", "LABEL_1"]:
18
  sentiment = "Positive"
19
  emoji = "😊"
20
  else: