Spaces:
Build error
Build error
Sathyam
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,9 +15,13 @@ if review_text:
|
|
| 15 |
# Predict sentiment
|
| 16 |
sentiment = pipe(review_text)
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# Display the result
|
| 19 |
-
st.write(f"Sentiment: {
|
| 20 |
-
st.write(f"Confidence: {
|
| 21 |
|
| 22 |
# Run the app
|
| 23 |
if __name__ == "__main__":
|
|
|
|
| 15 |
# Predict sentiment
|
| 16 |
sentiment = pipe(review_text)
|
| 17 |
|
| 18 |
+
# Extract the label and score
|
| 19 |
+
sentiment_label = sentiment[0]['label']
|
| 20 |
+
sentiment_score = sentiment[0]['score']
|
| 21 |
+
|
| 22 |
# Display the result
|
| 23 |
+
st.write(f"Sentiment: {sentiment_label}")
|
| 24 |
+
st.write(f"Confidence: {sentiment_score:.2f}")
|
| 25 |
|
| 26 |
# Run the app
|
| 27 |
if __name__ == "__main__":
|