Update app.py
Browse files
app.py
CHANGED
@@ -20,13 +20,18 @@ def main():
|
|
20 |
label = "Positive"
|
21 |
postive_score = score
|
22 |
negative_score = 1 - score
|
|
|
23 |
else:
|
24 |
label = "Negative"
|
25 |
postive_score = 1 - score
|
26 |
negative_score = score
|
|
|
27 |
|
|
|
|
|
|
|
28 |
st.write("Sentiment:")
|
29 |
-
st.write(
|
30 |
st.write(f"Positive Score: {postive_score:.2f}")
|
31 |
st.write(f"Negative Score: {negative_score:.2f}")
|
32 |
|
|
|
20 |
label = "Positive"
|
21 |
postive_score = score
|
22 |
negative_score = 1 - score
|
23 |
+
color = "green"
|
24 |
else:
|
25 |
label = "Negative"
|
26 |
postive_score = 1 - score
|
27 |
negative_score = score
|
28 |
+
color = "red"
|
29 |
|
30 |
+
style = f'color:{color}'
|
31 |
+
text = f'Sentiment Label: {label}'
|
32 |
+
sentiment_text = f'<h4 style="{style}">{text}</h4>'
|
33 |
st.write("Sentiment:")
|
34 |
+
st.write(sentiment_text, unsafe_allow_html=True)
|
35 |
st.write(f"Positive Score: {postive_score:.2f}")
|
36 |
st.write(f"Negative Score: {negative_score:.2f}")
|
37 |
|