Ryan commited on
Commit
f7e9b98
·
1 Parent(s): de89216
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -98,6 +98,8 @@ def create_app():
98
  # Use create_analysis_screen to get UI components including visualization container
99
  analysis_options, analysis_params, run_analysis_btn, analysis_output, ngram_n = create_analysis_screen()
100
 
 
 
101
  # Pre-create visualization components (initially hidden)
102
  visualization_area_visible = gr.Checkbox(value=False, visible=False, label="Visualization Visible")
103
  analysis_title = gr.Markdown("## Analysis Results", visible=False)
@@ -121,7 +123,7 @@ def create_app():
121
  status_message = gr.Markdown(visible=False)
122
 
123
  # Define a helper function to extract parameter values and run the analysis
124
- def run_analysis(dataset, selected_analysis, bow_top, ngram_n, ngram_top):
125
  try:
126
  if not dataset or "entries" not in dataset or not dataset["entries"]:
127
  return (
@@ -145,7 +147,8 @@ def create_app():
145
  "bow_top": bow_top,
146
  "ngram_n": ngram_n,
147
  "ngram_top": ngram_top,
148
- "topic_count": topic_count
 
149
  }
150
  print(f"Running analysis with selected type: {selected_analysis}")
151
  print("Parameters:", parameters)
@@ -489,7 +492,7 @@ def create_app():
489
  # Run analysis with proper parameters
490
  run_analysis_btn.click(
491
  fn=run_analysis,
492
- inputs=[dataset_state, analysis_options, ngram_n],
493
  outputs=[
494
  analysis_results_state,
495
  analysis_output,
 
98
  # Use create_analysis_screen to get UI components including visualization container
99
  analysis_options, analysis_params, run_analysis_btn, analysis_output, ngram_n = create_analysis_screen()
100
 
101
+ topic_count = gr.State(value=3)
102
+
103
  # Pre-create visualization components (initially hidden)
104
  visualization_area_visible = gr.Checkbox(value=False, visible=False, label="Visualization Visible")
105
  analysis_title = gr.Markdown("## Analysis Results", visible=False)
 
123
  status_message = gr.Markdown(visible=False)
124
 
125
  # Define a helper function to extract parameter values and run the analysis
126
+ def run_analysis(dataset, selected_analysis, bow_top, ngram_n, ngram_top, topic_count=3):
127
  try:
128
  if not dataset or "entries" not in dataset or not dataset["entries"]:
129
  return (
 
147
  "bow_top": bow_top,
148
  "ngram_n": ngram_n,
149
  "ngram_top": ngram_top,
150
+ "topic_count": topic_count,
151
+ "bias_methods": ["partisan"]
152
  }
153
  print(f"Running analysis with selected type: {selected_analysis}")
154
  print("Parameters:", parameters)
 
492
  # Run analysis with proper parameters
493
  run_analysis_btn.click(
494
  fn=run_analysis,
495
+ inputs=[dataset_state, analysis_options, ngram_n, topic_count],
496
  outputs=[
497
  analysis_results_state,
498
  analysis_output,