vm567 commited on
Commit
e4f7197
1 Parent(s): c812d7c

Code update

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,12 +9,12 @@ st.title('Sentiment Analysis with Hugging Face')
9
  st.write('Enter some text and we will predict its sentiment!')
10
 
11
  # Add a text input box for the user to enter text
12
- text_input = st.text_input('Enter text here')
13
 
14
  # When the user submits text, run the sentiment analysis model on it
15
  if st.button('Submit'):
16
  # Predict the sentiment of the text using the Hugging Face model
17
- sentiment = classifier(text_input)[0]['label']
18
 
19
  # Display the sentiment prediction to the user
20
- st.write(f'Sentiment: {sentiment}')
 
9
  st.write('Enter some text and we will predict its sentiment!')
10
 
11
  # Add a text input box for the user to enter text
12
+ input_text = st.text_input('Enter text here')
13
 
14
  # When the user submits text, run the sentiment analysis model on it
15
  if st.button('Submit'):
16
  # Predict the sentiment of the text using the Hugging Face model
17
+ sentiment_result = classifier(input_text)[0]['label']
18
 
19
  # Display the sentiment prediction to the user
20
+ st.write(f'Sentiment: {sentiment_result}')