Sathyam commited on
Commit
5489fcb
·
unverified ·
1 Parent(s): ad3c17a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
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: {sentiment[0]['label']}")
20
- st.write(f"Confidence: {sentiment[0]['score']:.2f}")
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__":