Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,13 +38,13 @@ def textclassification():
|
|
| 38 |
st.write(f"Sentiment: {sentiment}")
|
| 39 |
st.write(f"Confidence: {confidence:.2f}")
|
| 40 |
|
| 41 |
-
# Determine the rating based on
|
| 42 |
if sentiment == "POSITIVE":
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
rating =
|
| 48 |
|
| 49 |
# Display the rating
|
| 50 |
st.write(f"The rating is {rating} stars")
|
|
|
|
| 38 |
st.write(f"Sentiment: {sentiment}")
|
| 39 |
st.write(f"Confidence: {confidence:.2f}")
|
| 40 |
|
| 41 |
+
# Determine the rating based on sentiment
|
| 42 |
if sentiment == "POSITIVE":
|
| 43 |
+
rating = 5 # Assign a rating of 5 stars for positive sentiment
|
| 44 |
+
elif sentiment == "NEUTRAL":
|
| 45 |
+
rating = 3 # Assign a neutral rating of 3 stars
|
| 46 |
+
else: # Assuming the other sentiment is "NEGATIVE"
|
| 47 |
+
rating = 1 # Assign a rating of 1 star for negative sentiment
|
| 48 |
|
| 49 |
# Display the rating
|
| 50 |
st.write(f"The rating is {rating} stars")
|