hamxaameer commited on
Commit
50e00d8
·
verified ·
1 Parent(s): 313bbe8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -21
app.py CHANGED
@@ -204,29 +204,9 @@ with gr.Blocks(title="BERT Sentiment Analyzer", theme=gr.themes.Soft()) as demo:
204
  with gr.Row():
205
  analyze_btn = gr.Button("🔍 Analyze", variant="primary", size="lg")
206
  clear_btn = gr.Button("🗑️ Clear", size="sm")
207
-
208
- gr.Markdown("### 💡 Examples:")
209
- gr.Examples(
210
- examples=[
211
- ["This product is absolutely amazing! Best purchase ever!"],
212
- ["I love this so much! Outstanding quality!"],
213
- ["Excellent customer service and fast delivery!"],
214
- ["This is terrible! Worst product ever!"],
215
- ["Completely disappointed. Poor quality."],
216
- ["Awful experience. Would never buy again!"],
217
- ["The product is okay. Nothing special but works."],
218
- ["It's decent. Good value but could be better."],
219
- ["This is not bad at all"],
220
- ["Pretty good"],
221
- ],
222
- inputs=text_input,
223
- outputs=[result_output, confidence_plot, predicted_class, status_display],
224
- fn=analyze_sentiment,
225
- cache_examples=False
226
- )
227
 
228
  with gr.Column(scale=2):
229
- gr.Markdown("### 📊 Results")
230
 
231
  result_output = gr.Markdown("*Enter text to see results*")
232
 
@@ -241,6 +221,27 @@ with gr.Blocks(title="BERT Sentiment Analyzer", theme=gr.themes.Soft()) as demo:
241
  predicted_class = gr.Textbox(label="Prediction", interactive=False)
242
  status_display = gr.Textbox(label="Status", interactive=False, value="Ready")
243
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
  with gr.Accordion("ℹ️ Model Info", open=False):
245
  gr.Markdown("""
246
  ### 🧠 Model
 
204
  with gr.Row():
205
  analyze_btn = gr.Button("🔍 Analyze", variant="primary", size="lg")
206
  clear_btn = gr.Button("🗑️ Clear", size="sm")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
 
208
  with gr.Column(scale=2):
209
+ gr.Markdown("### Results")
210
 
211
  result_output = gr.Markdown("*Enter text to see results*")
212
 
 
221
  predicted_class = gr.Textbox(label="Prediction", interactive=False)
222
  status_display = gr.Textbox(label="Status", interactive=False, value="Ready")
223
 
224
+ # Examples - must be after outputs are defined
225
+ with gr.Row():
226
+ gr.Examples(
227
+ examples=[
228
+ ["This product is absolutely amazing! Best purchase ever!"],
229
+ ["I love this so much! Outstanding quality!"],
230
+ ["Excellent customer service and fast delivery!"],
231
+ ["This is terrible! Worst product ever!"],
232
+ ["Completely disappointed. Poor quality."],
233
+ ["Awful experience. Would never buy again!"],
234
+ ["The product is okay. Nothing special but works."],
235
+ ["It's decent. Good value but could be better."],
236
+ ["This is not bad at all"],
237
+ ["Pretty good"],
238
+ ],
239
+ inputs=text_input,
240
+ outputs=[result_output, confidence_plot, predicted_class, status_display],
241
+ fn=analyze_sentiment,
242
+ cache_examples=False
243
+ )
244
+
245
  with gr.Accordion("ℹ️ Model Info", open=False):
246
  gr.Markdown("""
247
  ### 🧠 Model