Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|