Spaces:
Runtime error
Runtime error
Oliver Li
commited on
Commit
·
f809eee
1
Parent(s):
4b4d3c0
added effects
Browse files
app.py
CHANGED
@@ -34,5 +34,9 @@ if st.button("Analyze"):
|
|
34 |
sentiment_pipeline = load_model(selected_model)
|
35 |
result = sentiment_pipeline(text)
|
36 |
st.write(f"Sentiment: {result[0]['label']} (confidence: {result[0]['score']:.2f})")
|
|
|
|
|
|
|
|
|
37 |
else:
|
38 |
st.write("Enter a text and click 'Analyze' to perform sentiment analysis.")
|
|
|
34 |
sentiment_pipeline = load_model(selected_model)
|
35 |
result = sentiment_pipeline(text)
|
36 |
st.write(f"Sentiment: {result[0]['label']} (confidence: {result[0]['score']:.2f})")
|
37 |
+
if result[0]['label'] == 'POSITIVE':
|
38 |
+
st.balloons()
|
39 |
+
else:
|
40 |
+
st.error("Hater detected.")
|
41 |
else:
|
42 |
st.write("Enter a text and click 'Analyze' to perform sentiment analysis.")
|