Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ st.markdown(
|
|
21 |
<style>
|
22 |
/* Background color for the title */
|
23 |
.title-container {
|
24 |
-
background-color: #
|
25 |
padding: 10px;
|
26 |
border-radius: 5px;
|
27 |
}
|
@@ -33,7 +33,7 @@ st.markdown(
|
|
33 |
}
|
34 |
/* Background color for the text area (feedback_input) */
|
35 |
.stTextArea textarea {
|
36 |
-
background-color: #
|
37 |
border-radius: 5px;
|
38 |
}
|
39 |
</style>
|
@@ -57,7 +57,7 @@ st.markdown(
|
|
57 |
"""
|
58 |
<div class="description-container">
|
59 |
This app uses Hugging Face models to detect the topics and intent of customer feedback
|
60 |
-
and determine the sentiment (positive or negative) for each relevant category.
|
61 |
A single feedback may belong to multiple categories, such as Pricing, Feature, and Customer Service.
|
62 |
The feedback is split into sentences, and each sentence is categorized and analyzed for sentiment.
|
63 |
Only categories with a confidence score >= 0.8 are displayed.
|
@@ -106,14 +106,10 @@ if st.button("Classify Feedback"):
|
|
106 |
sentiment_label = "NEGATIVE"
|
107 |
sentiment_icon = "π" # Thumbs-down icon for negative
|
108 |
sentiment_color = "red" # Red color for negative
|
109 |
-
|
110 |
sentiment_label = "POSITIVE"
|
111 |
sentiment_icon = "π" # Thumbs-up icon for positive
|
112 |
sentiment_color = "green" # Green color for positive
|
113 |
-
else:
|
114 |
-
sentiment_label = raw_label # Fallback in case of unexpected label
|
115 |
-
sentiment_icon = "β" # Question mark for unknown
|
116 |
-
sentiment_color = "gray" # Gray color for unknown
|
117 |
|
118 |
# Store the result for the category
|
119 |
category_results[label].append({
|
|
|
21 |
<style>
|
22 |
/* Background color for the title */
|
23 |
.title-container {
|
24 |
+
background-color: #f0f0f0; /* Light gray background */
|
25 |
padding: 10px;
|
26 |
border-radius: 5px;
|
27 |
}
|
|
|
33 |
}
|
34 |
/* Background color for the text area (feedback_input) */
|
35 |
.stTextArea textarea {
|
36 |
+
background-color: #e6f3ff; /* Light blue background */
|
37 |
border-radius: 5px;
|
38 |
}
|
39 |
</style>
|
|
|
57 |
"""
|
58 |
<div class="description-container">
|
59 |
This app uses Hugging Face models to detect the topics and intent of customer feedback
|
60 |
+
and determine the sentiment (positiveπ or negativeπ) for each relevant category.
|
61 |
A single feedback may belong to multiple categories, such as Pricing, Feature, and Customer Service.
|
62 |
The feedback is split into sentences, and each sentence is categorized and analyzed for sentiment.
|
63 |
Only categories with a confidence score >= 0.8 are displayed.
|
|
|
106 |
sentiment_label = "NEGATIVE"
|
107 |
sentiment_icon = "π" # Thumbs-down icon for negative
|
108 |
sentiment_color = "red" # Red color for negative
|
109 |
+
else raw_label == "LABEL_1":
|
110 |
sentiment_label = "POSITIVE"
|
111 |
sentiment_icon = "π" # Thumbs-up icon for positive
|
112 |
sentiment_color = "green" # Green color for positive
|
|
|
|
|
|
|
|
|
113 |
|
114 |
# Store the result for the category
|
115 |
category_results[label].append({
|