Dineth98 commited on
Commit
5685146
1 Parent(s): f888e9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
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(f"Sentiment Label: {label}")
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