pantdipendra
commited on
Update app.py
Browse files
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 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
|