Mjo98 commited on
Commit
bc98c80
·
1 Parent(s): 71d2fe1

add more examples & update reqs

Browse files
Files changed (2) hide show
  1. app.py +14 -2
  2. requirements.txt +1 -0
app.py CHANGED
@@ -205,7 +205,13 @@ def run_model(text: str):
205
  return ht, html
206
 
207
 
208
- EXAMPLE_TEXT = "السلام عليكم كيف حالك اليوم"
 
 
 
 
 
 
209
 
210
  with gr.Blocks(theme="soft", title="Arabic Turn Detector Debugger") as demo:
211
  gr.Markdown(
@@ -218,12 +224,18 @@ Red ⇒ agent should reply • Blue ⇒ agent should wait"""
218
  text_in = gr.Textbox(
219
  label="Input Text",
220
  info="Enter Arabic text to analyze.",
221
- value=EXAMPLE_TEXT,
222
  lines=4,
223
  text_align="right",
224
  rtl=True
225
  )
226
 
 
 
 
 
 
 
227
  run_btn = gr.Button("Run Analysis", variant="primary")
228
 
229
  with gr.Row():
 
205
  return ht, html
206
 
207
 
208
+ EXAMPLES = [
209
+ ["كيف حالك بشرنا عنك عساك بخير"],
210
+ ["رقم جوالي صفر خمسة سبعة ستة ستة واحد ثلاثة سبعة صفر صفر"],
211
+ ["او صخره صلبه تستخدم كاساس للمبنى وقال ان الزعماء الدينيين سيرفضون"],
212
+ ["هل يمكنك أن تخبرني عن"],
213
+ ["جمهورية الدومينيكان هي دولة تقع في الكاريبي على جزيرة هيسبانيولا التي تشترك فيها مع هايتي"],
214
+ ]
215
 
216
  with gr.Blocks(theme="soft", title="Arabic Turn Detector Debugger") as demo:
217
  gr.Markdown(
 
224
  text_in = gr.Textbox(
225
  label="Input Text",
226
  info="Enter Arabic text to analyze.",
227
+ value=EXAMPLES[0][0],
228
  lines=4,
229
  text_align="right",
230
  rtl=True
231
  )
232
 
233
+ gr.Examples(
234
+ examples=EXAMPLES,
235
+ inputs=[text_in],
236
+ label="Examples"
237
+ )
238
+
239
  run_btn = gr.Button("Run Analysis", variant="primary")
240
 
241
  with gr.Row():
requirements.txt CHANGED
@@ -4,3 +4,4 @@ huggingface_hub
4
  arabert
5
  pandas
6
  numpy
 
 
4
  arabert
5
  pandas
6
  numpy
7
+ matplotlib