Ryleeeee commited on
Commit
1eb4c51
·
verified ·
1 Parent(s): 565b361

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -6,7 +6,7 @@ sentiment_classifier = pipeline("text-classification",model='Ryleeeee/CustomSent
6
 
7
  # Streamlit application title and background image
8
  st.image("./header.png", use_column_width=True)
9
- st.header("Customer Review Analysis")
10
 
11
  st.write("Setiment classification: positive, netural, negative")
12
 
@@ -25,9 +25,12 @@ def sentiment_class(text):
25
 
26
 
27
  # Perform sentiment analysis when the user clicks the "Classify Sentiment" button
28
- if review is not None and st.button("Classify Sentiment"):
29
- # Perform sentiment analysis on the input text
30
- sentiment_result = sentiment_class(review)
31
- st.write("This review sentiment is ", sentiment_result[1])
32
- st.write("Prediction score is ", sentiment_result[0])
 
 
 
33
 
 
6
 
7
  # Streamlit application title and background image
8
  st.image("./header.png", use_column_width=True)
9
+ st.markdown("<h1 style='text-align: center;'>Customer Review Analysis</h1>", unsafe_allow_html=True)
10
 
11
  st.write("Setiment classification: positive, netural, negative")
12
 
 
25
 
26
 
27
  # Perform sentiment analysis when the user clicks the "Classify Sentiment" button
28
+ if st.button("Classify Sentiment"):
29
+ if review is None or review.strip() == '':
30
+ st.warning("Please enter a review.")
31
+ else:
32
+ # Perform sentiment analysis on the input text
33
+ sentiment_result = sentiment_class(review)
34
+ st.write("This review sentiment is ", sentiment_result[1])
35
+ st.write("Prediction score is ", sentiment_result[0])
36