Spaces:
Runtime error
Runtime error
vm567
commited on
Commit
•
e4f7197
1
Parent(s):
c812d7c
Code update
Browse files
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 |
-
|
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 |
-
|
18 |
|
19 |
# Display the sentiment prediction to the user
|
20 |
-
st.write(f'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}')
|