Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ if file is not None:
|
|
25 |
|
26 |
# Write the total number of records
|
27 |
st.markdown(
|
28 |
-
f'<div style="background-color: #
|
29 |
unsafe_allow_html=True
|
30 |
)
|
31 |
|
@@ -34,7 +34,7 @@ if file is not None:
|
|
34 |
|
35 |
# Generate pie chart
|
36 |
# Define custom colors
|
37 |
-
colors = ['#
|
38 |
|
39 |
# Generate pie chart
|
40 |
sentiment_counts = df["Sentiment"].value_counts()
|
@@ -47,22 +47,22 @@ if file is not None:
|
|
47 |
negative_reviews = " ".join(df[df["Sentiment"] == "NEGATIVE"]["Review"].tolist())
|
48 |
|
49 |
st.markdown(
|
50 |
-
f'<div style="background-color: #
|
51 |
unsafe_allow_html=True
|
52 |
)
|
53 |
-
wc = WordCloud(width=800, height=400, background_color="white", colormap="
|
54 |
-
st.image(wc.to_array(),use_column_width=
|
55 |
|
56 |
st.markdown(
|
57 |
-
f'<div style="background-color: #
|
58 |
unsafe_allow_html=True
|
59 |
)
|
60 |
-
wc = WordCloud(width=800, height=400, background_color="white", colormap="
|
61 |
-
st.image(wc.to_array(),use_column_width=
|
62 |
|
63 |
# Display the sentiment of each review as cards
|
64 |
st.markdown(
|
65 |
-
f'<div style="background-color: #
|
66 |
unsafe_allow_html=True
|
67 |
)
|
68 |
|
@@ -85,4 +85,4 @@ if file is not None:
|
|
85 |
|
86 |
|
87 |
else:
|
88 |
-
st.write("Please upload a CSV file.")
|
|
|
25 |
|
26 |
# Write the total number of records
|
27 |
st.markdown(
|
28 |
+
f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 8px; font-size: 30px; font-family: Open-Sans; font-weight: bold; text-align: center; border-radius: 2rem"> {len(df)} reviews to analyse!</div>',
|
29 |
unsafe_allow_html=True
|
30 |
)
|
31 |
|
|
|
34 |
|
35 |
# Generate pie chart
|
36 |
# Define custom colors
|
37 |
+
colors = ['#30C3C4', '#D1DDDE']
|
38 |
|
39 |
# Generate pie chart
|
40 |
sentiment_counts = df["Sentiment"].value_counts()
|
|
|
47 |
negative_reviews = " ".join(df[df["Sentiment"] == "NEGATIVE"]["Review"].tolist())
|
48 |
|
49 |
st.markdown(
|
50 |
+
f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Open-Sans; font-weight: bold; text-align: center; margin-bottom: 40px; border-radius: 2rem"> Causes behind Positive Reviews</div>',
|
51 |
unsafe_allow_html=True
|
52 |
)
|
53 |
+
wc = WordCloud(width=800, height=400, background_color="white", colormap="winter").generate(positive_reviews)
|
54 |
+
st.image(wc.to_array(),use_column_width=False, width=800)
|
55 |
|
56 |
st.markdown(
|
57 |
+
f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Open-Sans; font-weight: bold; text-align: center; margin-bottom: 40px; margin-top: 60px; border-radius: 2rem"> Causes behind Negative Reviews</div>',
|
58 |
unsafe_allow_html=True
|
59 |
)
|
60 |
+
wc = WordCloud(width=800, height=400, background_color="white", colormap="Blues").generate(negative_reviews)
|
61 |
+
st.image(wc.to_array(),use_column_width=False)
|
62 |
|
63 |
# Display the sentiment of each review as cards
|
64 |
st.markdown(
|
65 |
+
f'<div style="background-color: #4AA6DD; color: #ffffff; padding: 6px; font-size: 20px; font-family: Open-Sans; font-weight: bold; text-align: center; margin-top: 60px; border-radius: 2rem"> What customers said about us</div>',
|
66 |
unsafe_allow_html=True
|
67 |
)
|
68 |
|
|
|
85 |
|
86 |
|
87 |
else:
|
88 |
+
st.write("Please upload a CSV file.")
|