pantdipendra commited on
Commit
4848b3d
·
verified ·
1 Parent(s): e84fe7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -449,10 +449,18 @@ with gr.Blocks(css=".gradio-container {max-width: 1200px;}") as demo:
449
  # Second Tab: Co-occurrence on demand
450
  with gr.Tab("Co-occurrence"):
451
  gr.Markdown("## Co-Occurrence Plot\nSelect two features + one label to see a distribution.")
452
- with gr.Row():
453
- feat1_dd = gr.Dropdown(sorted(df.columns), label="Feature 1")
454
- feat2_dd = gr.Dropdown(sorted(df.columns), label="Feature 2")
455
- label_dd = gr.Dropdown(sorted(df.columns), label="Label Column")
 
 
 
 
 
 
 
 
456
  generate_btn = gr.Button("Generate Plot")
457
  co_occ_output = gr.Plot()
458
 
 
449
  # Second Tab: Co-occurrence on demand
450
  with gr.Tab("Co-occurrence"):
451
  gr.Markdown("## Co-Occurrence Plot\nSelect two features + one label to see a distribution.")
452
+
453
+ # 1) We gather the 'input features' from input_mapping keys:
454
+ list_of_features = sorted(input_mapping.keys())
455
+
456
+ # 2) We gather the 'label columns' from predictor.prediction_map keys:
457
+ list_of_labels = sorted(predictor.prediction_map.keys())
458
+
459
+ # 3) Build three dropdowns:
460
+ feat1_dd = gr.Dropdown(choices=list_of_features, label="Feature 1")
461
+ feat2_dd = gr.Dropdown(choices=list_of_features, label="Feature 2")
462
+ label_dd = gr.Dropdown(choices=list_of_labels, label="Label Column")
463
+
464
  generate_btn = gr.Button("Generate Plot")
465
  co_occ_output = gr.Plot()
466