Ansh commited on
Commit
da5456d
·
1 Parent(s): b94d482

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -30,7 +30,7 @@ def run():
30
 
31
  st.sidebar.subheader("Show random tweet")
32
  random_tweet = st.sidebar.radio('Sentiment', ('-1','1'))
33
- st.sidebar.markdown(data.query('Labels1 == @random_tweet')[["Text"]].sample(n=1).iat[0,0])
34
 
35
  st.sidebar.markdown("### Number of tweets by sentiment")
36
  select = st.sidebar.selectbox('Visualization type', ['Histogram', 'Pie chart'])
@@ -63,9 +63,9 @@ def run():
63
  choice_data = data[data.language.isin(choice)]
64
  fig_choice = px.histogram(choice_data, x='language',
65
  y='sentiment_flair',
66
- histfunc = 'count', color = 'sentiment_flair',
67
- facet_col='sentiment_flair',
68
- labels={'sentiment_flair':'tweets'}, height=600, width=800)
69
  st.plotly_chart(fig_choice)
70
 
71
  st.sidebar.header("Word Cloud")
 
30
 
31
  st.sidebar.subheader("Show random tweet")
32
  random_tweet = st.sidebar.radio('Sentiment', ('-1','1'))
33
+ st.sidebar.markdown(data.query('Labels1 == @random_tweet')[["text_clean_translated"]].sample(n=1).iat[0,0])
34
 
35
  st.sidebar.markdown("### Number of tweets by sentiment")
36
  select = st.sidebar.selectbox('Visualization type', ['Histogram', 'Pie chart'])
 
63
  choice_data = data[data.language.isin(choice)]
64
  fig_choice = px.histogram(choice_data, x='language',
65
  y='sentiment_flair',
66
+ histfunc = 'count', color = 'Labels1',
67
+ facet_col='Labels1',
68
+ labels={'Labels1':'tweets'}, height=600, width=800)
69
  st.plotly_chart(fig_choice)
70
 
71
  st.sidebar.header("Word Cloud")