Spaces:
Runtime error
Runtime error
fix: the presentation of sentiment
Browse files- src/streamlit_app.py +6 -2
src/streamlit_app.py
CHANGED
|
@@ -23,7 +23,11 @@ if st.button("Analyze Sentiment"):
|
|
| 23 |
label = result[0]['label']
|
| 24 |
score = result[0]['score']
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
else:
|
| 29 |
st.write("Please enter some text to analyze.")
|
|
|
|
| 23 |
label = result[0]['label']
|
| 24 |
score = result[0]['score']
|
| 25 |
|
| 26 |
+
if label == 'LABEL_1':
|
| 27 |
+
st.write(f"Sentiment: Its Positive tweet")
|
| 28 |
+
st.write(f"Confidence Score: {score:.4f}")
|
| 29 |
+
else:
|
| 30 |
+
st.write(f"Sentiment: Its Negative tweet")
|
| 31 |
+
st.write(f"Confidence Score: {score:.4f}")
|
| 32 |
else:
|
| 33 |
st.write("Please enter some text to analyze.")
|