JethroDD commited on
Commit
9d3c70e
1 Parent(s): 679edd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -13,6 +13,11 @@ def sentiment(comment):
13
  model = pipeline("text-classification", model="JethroDD/twitter-roberta-base-sentiment-CustomModel_imdb")
14
  outputs = model(comment)
15
  result_text =outputs[0]["label"]
 
 
 
 
 
16
  print(f"The predicted class is {result_text}")
17
 
18
  return result_text
 
13
  model = pipeline("text-classification", model="JethroDD/twitter-roberta-base-sentiment-CustomModel_imdb")
14
  outputs = model(comment)
15
  result_text =outputs[0]["label"]
16
+ if result_text == "LABEL_1":
17
+ result_text = "Positive"
18
+ elif result_text == "LABEL_0":
19
+ result_text = "Negative"
20
+
21
  print(f"The predicted class is {result_text}")
22
 
23
  return result_text