Uvini commited on
Commit
2dac422
1 Parent(s): 7212a1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -48,22 +48,23 @@ if file is not None:
48
  negative_reviews = " ".join(df[df["Sentiment"] == "NEGATIVE"]["Review"].tolist())
49
 
50
  # Center-align the word clouds
51
-
52
-
53
- st.markdown(
54
- f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Verdana; font-weight: bold; text-align: center; margin-bottom: 40px; border-radius: 1rem">Causes behind Positive Reviews</div>',
55
- unsafe_allow_html=True
56
- )
57
-
58
- wc = WordCloud(width=800, height=300, background_color="white", colormap="winter").generate(positive_reviews)
59
- st.image(wc.to_array(),use_column_width=True)
60
-
61
- st.markdown(
62
- f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Verdana; font-weight: bold; text-align: center; margin-bottom: 40px; margin-top: 60px; border-radius: 1rem"> Causes behind Negative Reviews</div>',
63
- unsafe_allow_html=True
64
- )
65
- wc = WordCloud(width=800, height=400, background_color="white", colormap="winter").generate(negative_reviews)
66
- st.image(wc.to_array(),use_column_width=True)
 
67
 
68
  # Display the sentiment of each review as cards
69
  st.markdown(
 
48
  negative_reviews = " ".join(df[df["Sentiment"] == "NEGATIVE"]["Review"].tolist())
49
 
50
  # Center-align the word clouds
51
+ col1, col2 = st.columns(2)
52
+
53
+ with col1:
54
+ st.markdown(
55
+ f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Verdana; font-weight: bold; text-align: center; margin-bottom: 40px; border-radius: 1rem">Causes behind Positive Reviews</div>',
56
+ unsafe_allow_html=True
57
+ )
58
+ wc_pos = WordCloud(width=800, height=400, background_color="white", colormap="winter").generate(positive_reviews)
59
+ st.image(wc_pos.to_array(),use_column_width=True)
60
+
61
+ with col2:
62
+ st.markdown(
63
+ f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Verdana; font-weight: bold; text-align: center; margin-bottom: 40px; margin-top: 60px; border-radius: 1rem"> Causes behind Negative Reviews</div>',
64
+ unsafe_allow_html=True
65
+ )
66
+ wc_neg = WordCloud(width=800, height=400, background_color="white", colormap="winter").generate(negative_reviews)
67
+ st.image(wc_neg.to_array(),use_column_width=True)
68
 
69
  # Display the sentiment of each review as cards
70
  st.markdown(