Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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')[["
|
| 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 = '
|
| 67 |
-
facet_col='
|
| 68 |
-
labels={'
|
| 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")
|