AlanOC commited on
Commit
4ab740b
1 Parent(s): b6d4832

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -59,6 +59,13 @@ avatar_10 = get_image_base64("avatar_10.png")
59
  avatar_11 = get_image_base64("avatar_11.png")
60
  avatar_12 = get_image_base64("avatar_12.png")
61
  icon_base64 = get_image_base64("clipboard.png")
 
 
 
 
 
 
 
62
 
63
 
64
 
@@ -986,7 +993,18 @@ def info_page():
986
 
987
 
988
 
 
 
 
 
 
 
 
 
 
989
 
 
 
990
 
991
 
992
 
 
59
  avatar_11 = get_image_base64("avatar_11.png")
60
  avatar_12 = get_image_base64("avatar_12.png")
61
  icon_base64 = get_image_base64("clipboard.png")
62
+
63
+
64
+ # Load your sentiment analysis data (replace 'your_data.csv' with your actual file)
65
+ df = pd.read_csv('./data/Consumer_sentiment_analysis_results.csv')
66
+
67
+
68
+
69
 
70
 
71
 
 
993
 
994
 
995
 
996
+ # Create a bar chart using Plotly Express
997
+ fig = px.bar(df, x='Title', y=['Negative', 'Neutral', 'Positive'],
998
+ color_discrete_map={'Negative': 'red', 'Neutral': 'gray', 'Positive': 'green'},
999
+ title='Sentiment Analysis by Section')
1000
+
1001
+ # Customize the layout
1002
+ fig.update_xaxes(title='Section')
1003
+ fig.update_yaxes(title='Sentiment Score')
1004
+ fig.update_layout(barmode='stack')
1005
 
1006
+ # Display the chart in Streamlit
1007
+ st.plotly_chart(fig)
1008
 
1009
 
1010