Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +10 -4
src/streamlit_app.py
CHANGED
|
@@ -51,7 +51,7 @@ else:
|
|
| 51 |
st.warning("No reviews match the selected filters.")
|
| 52 |
|
| 53 |
# Top complaint words
|
| 54 |
-
st.subheader("
|
| 55 |
|
| 56 |
negative_reviews = filtered_df[filtered_df["sentiment"] == "negative"]["review_text"]
|
| 57 |
|
|
@@ -64,10 +64,16 @@ if len(negative_reviews) > 0:
|
|
| 64 |
"a", "an", "this", "that", "with", "on", "at", "my", "our", "we",
|
| 65 |
"i", "had", "but", "very", "so", "not", "be", "been", "are", "as",
|
| 66 |
"they", "them", "you", "he", "she", "his", "her", "their", "there",
|
| 67 |
-
"here", "have", "has", "from", "too", "all"
|
|
|
|
|
|
|
|
|
|
| 68 |
}
|
| 69 |
|
| 70 |
-
filtered_words = [
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
if filtered_words:
|
| 73 |
word_counts = Counter(filtered_words).most_common(10)
|
|
@@ -76,7 +82,7 @@ if len(negative_reviews) > 0:
|
|
| 76 |
else:
|
| 77 |
st.info("No meaningful complaint words found.")
|
| 78 |
else:
|
| 79 |
-
st.info("No negative reviews available
|
| 80 |
|
| 81 |
# Example reviews
|
| 82 |
st.subheader("Example Customer Reviews")
|
|
|
|
| 51 |
st.warning("No reviews match the selected filters.")
|
| 52 |
|
| 53 |
# Top complaint words
|
| 54 |
+
st.subheader("Key Complaint Drivers")
|
| 55 |
|
| 56 |
negative_reviews = filtered_df[filtered_df["sentiment"] == "negative"]["review_text"]
|
| 57 |
|
|
|
|
| 64 |
"a", "an", "this", "that", "with", "on", "at", "my", "our", "we",
|
| 65 |
"i", "had", "but", "very", "so", "not", "be", "been", "are", "as",
|
| 66 |
"they", "them", "you", "he", "she", "his", "her", "their", "there",
|
| 67 |
+
"here", "have", "has", "from", "too", "all",
|
| 68 |
+
"will", "would", "back", "one", "get", "got", "go", "went",
|
| 69 |
+
"also", "even", "still", "really", "just", "make", "made",
|
| 70 |
+
"time", "day", "thing", "things", "place"
|
| 71 |
}
|
| 72 |
|
| 73 |
+
filtered_words = [
|
| 74 |
+
word for word in words
|
| 75 |
+
if word not in stopwords and len(word) > 3
|
| 76 |
+
]
|
| 77 |
|
| 78 |
if filtered_words:
|
| 79 |
word_counts = Counter(filtered_words).most_common(10)
|
|
|
|
| 82 |
else:
|
| 83 |
st.info("No meaningful complaint words found.")
|
| 84 |
else:
|
| 85 |
+
st.info("No negative reviews available.")
|
| 86 |
|
| 87 |
# Example reviews
|
| 88 |
st.subheader("Example Customer Reviews")
|