sdbrgo commited on
Commit
b8c6ce7
·
verified ·
1 Parent(s): 479cb3f

Update app.py

Browse files

assigned PCI and SPA to a different container

Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -33,9 +33,9 @@ def run_app(feedback_file, adoption_file, num_participants, target_population, h
33
  pai_1, pai_2 = pai_calculator.compute_pai(participants_by_group)
34
 
35
  # Step 4: Interpret results
36
- typology = assign_typology(pai_1, pai_2, high_th, th)
37
 
38
- return sentiment_metrics, typology
39
 
40
  # ========== GRADIO INTERFACE ==========
41
  with gr.Blocks() as demo:
@@ -86,17 +86,19 @@ with gr.Blocks() as demo:
86
 
87
  # ----- OUTPUTS -----
88
  with gr.Row():
89
- with gr.Column(scale=4):
90
  gr.Markdown("## 🗨️📈Public Sentiment Analytics")
91
  sentiment_metrics_output = gr.JSON(label="Sentiment Metrics")
92
- with gr.Column(scale=3):
93
- gr.Markdown("## 📃🩺Program Diagnosis")
94
- typology_output = gr.JSON(label="Typology Assignment")
 
 
95
 
96
  btn.click(
97
  fn=run_app,
98
  inputs=[feedback_file_input, adoption_file_input, num_participants_input, target_population_input, high_th_input, th_input],
99
- outputs=[sentiment_metrics_output, typology_output]
100
  )
101
 
102
  demo.launch()
 
33
  pai_1, pai_2 = pai_calculator.compute_pai(participants_by_group)
34
 
35
  # Step 4: Interpret results
36
+ typology = assign_typology(pai_1, high_th, th)
37
 
38
+ return sentiment_metrics, typology, pai_2
39
 
40
  # ========== GRADIO INTERFACE ==========
41
  with gr.Blocks() as demo:
 
86
 
87
  # ----- OUTPUTS -----
88
  with gr.Row():
89
+ with gr.Column(scale=1):
90
  gr.Markdown("## 🗨️📈Public Sentiment Analytics")
91
  sentiment_metrics_output = gr.JSON(label="Sentiment Metrics")
92
+ gr.Markdown("## 📃🩺Program Diagnosis Pt.1")
93
+ pai_2_output = gr.JSON(label="Typology Assignment Pt.1")
94
+ with gr.Column(scale=1):
95
+ gr.Markdown("## 📃🩺Program Diagnosis Pt.2")
96
+ typology_output = gr.JSON(label="Typology Assignment Pt.2")
97
 
98
  btn.click(
99
  fn=run_app,
100
  inputs=[feedback_file_input, adoption_file_input, num_participants_input, target_population_input, high_th_input, th_input],
101
+ outputs=[sentiment_metrics_output, typology_output, pai_2_output]
102
  )
103
 
104
  demo.launch()