vietexob commited on
Commit
922de3f
·
1 Parent(s): 8e81f52

Changed drop-down menu to radio buttons

Browse files
Files changed (2) hide show
  1. app.py +24 -8
  2. sample/kv_store_doc_status.json +17 -0
app.py CHANGED
@@ -305,6 +305,7 @@ def process_and_visualize(text, model_name, progress=gr.Progress()):
305
 
306
  # Example texts
307
  EXAMPLES = [
 
308
  [handle_text("""The family of Azerbaijan President Ilham Aliyev leads a charmed, glamorous life, thanks in part to financial interests in almost every sector of the economy.
309
  His wife, Mehriban, comes from the privileged and powerful Pashayev family that owns banks, insurance and construction companies,
310
  a television station and a line of cosmetics. She has led the Heydar Aliyev Foundation, Azerbaijan's pre-eminent charity behind the construction of schools,
@@ -313,16 +314,25 @@ EXAMPLES = [
313
  Arzu is also a significant shareholder in SW Holding, which controls nearly every operation related to Azerbaijan Airlines (“Azal”), from meals to airport taxis.
314
  Both sisters and brother Heydar own property in Dubai valued at roughly $75 million in 2010;
315
  Heydar is the legal owner of nine luxury mansions in Dubai purchased for some $44 million.""")],
316
-
317
- [handle_text("""Legendary rock band Aerosmith has officially announced their retirement from touring after 54 years,
318
- citing lead singer Steven Tyler's unrecoverable vocal cord injury.
319
- The decision comes after months of unsuccessful treatment for Tyler's fractured larynx, which he suffered in September 2023.""")],
320
 
321
  [handle_text("""Les jardins du Luxembourg, situés au cœur du sixième arrondissement de Paris, offrent un véritable havre de paix aux citadins pressés.
322
  Créés au début du dix-septième siècle sur l'initiative de Marie de Médicis, ces jardins à la française s'étendent sur vingt-trois hectares
323
  et abritent le Palais du Luxembourg, siège du Sénat français. Les promeneurs peuvent y admirer les parterres de fleurs soigneusement entretenus,
324
  les bassins ornés de statues mythologiques, et les allées bordées de marronniers centenaires. Chaque matin, les jardiniers s'affairent à tailler
325
  les buis et à arroser les rosiers, perpétuant ainsi une tradition d'excellence horticole qui fait la fierté de la capitale française.""")],
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  ]
327
 
328
  def generate_first_example():
@@ -390,13 +400,19 @@ def create_ui():
390
  with gr.Row():
391
  # Left panel - Input controls
392
  with gr.Column(scale=1):
393
- input_model = gr.Dropdown(
394
- MODEL_LIST,
 
 
 
 
 
 
395
  label="🤖 Select Model",
396
  info="Choose a model to process your text",
397
- value=MODEL_LIST[0] if MODEL_LIST else None
398
  )
399
-
400
  input_text = gr.TextArea(
401
  label="📝 Input Text",
402
  info="Enter text in any language to extract a knowledge graph",
 
305
 
306
  # Example texts
307
  EXAMPLES = [
308
+ # TODO: Pull these texts out into separate files
309
  [handle_text("""The family of Azerbaijan President Ilham Aliyev leads a charmed, glamorous life, thanks in part to financial interests in almost every sector of the economy.
310
  His wife, Mehriban, comes from the privileged and powerful Pashayev family that owns banks, insurance and construction companies,
311
  a television station and a line of cosmetics. She has led the Heydar Aliyev Foundation, Azerbaijan's pre-eminent charity behind the construction of schools,
 
314
  Arzu is also a significant shareholder in SW Holding, which controls nearly every operation related to Azerbaijan Airlines (“Azal”), from meals to airport taxis.
315
  Both sisters and brother Heydar own property in Dubai valued at roughly $75 million in 2010;
316
  Heydar is the legal owner of nine luxury mansions in Dubai purchased for some $44 million.""")],
 
 
 
 
317
 
318
  [handle_text("""Les jardins du Luxembourg, situés au cœur du sixième arrondissement de Paris, offrent un véritable havre de paix aux citadins pressés.
319
  Créés au début du dix-septième siècle sur l'initiative de Marie de Médicis, ces jardins à la française s'étendent sur vingt-trois hectares
320
  et abritent le Palais du Luxembourg, siège du Sénat français. Les promeneurs peuvent y admirer les parterres de fleurs soigneusement entretenus,
321
  les bassins ornés de statues mythologiques, et les allées bordées de marronniers centenaires. Chaque matin, les jardiniers s'affairent à tailler
322
  les buis et à arroser les rosiers, perpétuant ainsi une tradition d'excellence horticole qui fait la fierté de la capitale française.""")],
323
+
324
+ [handle_text("""In a groundbreaking development, researchers at the Massachusetts Institute of Technology (MIT) have unveiled a new type of battery that promises to revolutionize energy storage.
325
+ This lithium-sulfur battery boasts a significantly higher energy density compared to traditional lithium-ion batteries, potentially extending the range of electric vehicles and the lifespan of portable electronics.
326
+ The team, led by Dr. Jane Smith, has been working on this technology for over five years, overcoming numerous challenges related to sulfur's conductivity and stability.
327
+ The new battery design incorporates a novel cathode structure that enhances performance and durability.
328
+ With successful prototype tests already completed, the researchers are now collaborating with industry partners to scale up production and bring this innovative solution to market within the next few years.""")],
329
+
330
+ [handle_text("""Los mercados callejeros son el corazón vibrante de muchas ciudades alrededor del mundo. Desde los coloridos puestos de frutas y verduras frescas
331
+ hasta los aromas tentadores de la comida callejera, estos espacios no solo ofrecen productos locales, sino también una experiencia cultural única.
332
+ En ellos, es común escuchar el regateo amable entre vendedores y clientes, mientras los sonidos de la música tradicional se mezclan con el bullicio
333
+ de la multitud. Además, son lugares ideales para descubrir artesanías hechas a mano, como tejidos, cerámicas o joyería, que reflejan la creatividad
334
+ y las tradiciones de la región. Visitar un mercado callejero es sumergirse en la esencia misma de una comunidad, donde cada rincón cuenta una historia
335
+ y cada sabor evoca recuerdos.""")],
336
  ]
337
 
338
  def generate_first_example():
 
400
  with gr.Row():
401
  # Left panel - Input controls
402
  with gr.Column(scale=1):
403
+ # input_model = gr.Dropdown(
404
+ # MODEL_LIST,
405
+ # label="🤖 Select Model",
406
+ # info="Choose a model to process your text",
407
+ # value=MODEL_LIST[0] if MODEL_LIST else None,
408
+ # )
409
+ input_model = gr.Radio(
410
+ MODEL_LIST,
411
  label="🤖 Select Model",
412
  info="Choose a model to process your text",
413
+ value=MODEL_LIST[1] if MODEL_LIST else None,
414
  )
415
+
416
  input_text = gr.TextArea(
417
  label="📝 Input Text",
418
  info="Enter text in any language to extract a knowledge graph",
sample/kv_store_doc_status.json CHANGED
@@ -15,5 +15,22 @@
15
  "processing_start_time": 1756738390,
16
  "processing_end_time": 1756738484
17
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
  }
 
15
  "processing_start_time": 1756738390,
16
  "processing_end_time": 1756738484
17
  }
18
+ },
19
+ "doc-e5293d4d2bbfd7c4251e9718c5c5a1c1": {
20
+ "status": "processed",
21
+ "chunks_count": 1,
22
+ "chunks_list": [
23
+ "chunk-e5293d4d2bbfd7c4251e9718c5c5a1c1"
24
+ ],
25
+ "content_summary": "Los mercados callejeros son el corazón vibrante de muchas ciudades alrededor del mundo. Desde los coloridos puestos de frutas y verduras frescas hasta los aromas tentadores de la comida callejera, estos espacios no solo ofrecen productos locales, sin...",
26
+ "content_length": 768,
27
+ "created_at": "2025-09-04T09:22:22.653816+00:00",
28
+ "updated_at": "2025-09-04T09:23:29.962000+00:00",
29
+ "file_path": "unknown_source",
30
+ "track_id": "insert_20250904_172222_40ea51ac",
31
+ "metadata": {
32
+ "processing_start_time": 1756977742,
33
+ "processing_end_time": 1756977809
34
+ }
35
  }
36
  }