Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,7 +77,7 @@ with gr.Blocks() as nps:
|
|
| 77 |
categories = gr.State([])
|
| 78 |
|
| 79 |
# App title
|
| 80 |
-
gr.Markdown("# Customer Comment Classifier")
|
| 81 |
|
| 82 |
# Short explanation
|
| 83 |
gr.Markdown("""
|
|
@@ -89,14 +89,14 @@ with gr.Blocks() as nps:
|
|
| 89 |
# File upload and instructions
|
| 90 |
with gr.Row():
|
| 91 |
with gr.Column(scale=1):
|
| 92 |
-
uploaded_file = gr.File(label="Upload CSV", type="filepath", scale=1)
|
| 93 |
with gr.Column(scale=1):
|
| 94 |
gr.Markdown("""
|
| 95 |
-
|
| 96 |
- Upload a CSV file with at least one column: `customer_comment`.
|
| 97 |
- If you don't have your own data, click **Use Template** to load a sample dataset.
|
| 98 |
""")
|
| 99 |
-
template_btn = gr.Button("Use Template", size="sm")
|
| 100 |
|
| 101 |
gr.Markdown("---")
|
| 102 |
|
|
@@ -104,15 +104,15 @@ with gr.Blocks() as nps:
|
|
| 104 |
with gr.Row():
|
| 105 |
with gr.Column(scale=1):
|
| 106 |
# Category input and buttons
|
| 107 |
-
category_input = gr.Textbox(label="New Category", placeholder="Enter category name", scale=1)
|
| 108 |
with gr.Row():
|
| 109 |
-
add_category_btn = gr.Button("Add Category", size="sm")
|
| 110 |
-
reset_btn = gr.Button("Reset Categories", size="sm")
|
| 111 |
# Category display
|
| 112 |
-
category_status = gr.Markdown("
|
| 113 |
with gr.Column(scale=1):
|
| 114 |
gr.Markdown("""
|
| 115 |
-
|
| 116 |
- Enter a category name and click **Add Category** to add it to the list.
|
| 117 |
- Click **Reset Categories** to clear the list.
|
| 118 |
- The `customer_comment` field will be categorized based on the categories you provide.
|
|
@@ -123,7 +123,7 @@ with gr.Blocks() as nps:
|
|
| 123 |
# Classify button and output
|
| 124 |
with gr.Row():
|
| 125 |
with gr.Column(scale=1):
|
| 126 |
-
classify_btn = gr.Button("Classify", size="sm")
|
| 127 |
with gr.Column(scale=3): # Center the container and make it 75% of the window width
|
| 128 |
output = gr.HTML()
|
| 129 |
|
|
|
|
| 77 |
categories = gr.State([])
|
| 78 |
|
| 79 |
# App title
|
| 80 |
+
gr.Markdown("# π Customer Comment Classifier π")
|
| 81 |
|
| 82 |
# Short explanation
|
| 83 |
gr.Markdown("""
|
|
|
|
| 89 |
# File upload and instructions
|
| 90 |
with gr.Row():
|
| 91 |
with gr.Column(scale=1):
|
| 92 |
+
uploaded_file = gr.File(label="π Upload CSV", type="filepath", scale=1)
|
| 93 |
with gr.Column(scale=1):
|
| 94 |
gr.Markdown("""
|
| 95 |
+
**π Instructions:**
|
| 96 |
- Upload a CSV file with at least one column: `customer_comment`.
|
| 97 |
- If you don't have your own data, click **Use Template** to load a sample dataset.
|
| 98 |
""")
|
| 99 |
+
template_btn = gr.Button("β¨ Use Template", size="sm", variant="primary")
|
| 100 |
|
| 101 |
gr.Markdown("---")
|
| 102 |
|
|
|
|
| 104 |
with gr.Row():
|
| 105 |
with gr.Column(scale=1):
|
| 106 |
# Category input and buttons
|
| 107 |
+
category_input = gr.Textbox(label="π New Category", placeholder="Enter category name", scale=1)
|
| 108 |
with gr.Row():
|
| 109 |
+
add_category_btn = gr.Button("β Add Category", size="sm", variant="primary")
|
| 110 |
+
reset_btn = gr.Button("π Reset Categories", size="sm", variant="secondary")
|
| 111 |
# Category display
|
| 112 |
+
category_status = gr.Markdown("**π Categories:**\n- None")
|
| 113 |
with gr.Column(scale=1):
|
| 114 |
gr.Markdown("""
|
| 115 |
+
**π Instructions:**
|
| 116 |
- Enter a category name and click **Add Category** to add it to the list.
|
| 117 |
- Click **Reset Categories** to clear the list.
|
| 118 |
- The `customer_comment` field will be categorized based on the categories you provide.
|
|
|
|
| 123 |
# Classify button and output
|
| 124 |
with gr.Row():
|
| 125 |
with gr.Column(scale=1):
|
| 126 |
+
classify_btn = gr.Button("π Classify", size="sm", variant="primary")
|
| 127 |
with gr.Column(scale=3): # Center the container and make it 75% of the window width
|
| 128 |
output = gr.HTML()
|
| 129 |
|