ncoop57 commited on
Commit
37ed6eb
1 Parent(s): cfeaf7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -47,7 +47,7 @@ for name in dataset_names:
47
  "check_flagged_words_criteria": np.array(ds["check_flagged_words_criteria"]),
48
  "check_stop_word_ratio_criteria": np.array(ds["check_stop_word_ratio_criteria"]),
49
  "check_perplexity_criteria": np.array(ds["check_perplexity_criteria"]),
50
- "check_language_criteria": np.array(ds["check_language_criteria"]),
51
  }
52
 
53
  def plt_plot(criteria, dataset, threshold):
@@ -155,15 +155,15 @@ with gr.Blocks() as demo:
155
  check_fn = partial(check_filtered, "check_perplexity_criteria")
156
  check.click(check_fn, [dataset, threshold], filtered_data)
157
 
158
- with gr.Tab("Language Detection Criteria"):
159
  plot = gr.Plot()
160
  threshold = gr.Slider(minimum=0, maximum=1, label="Threshold")
161
  calculate = gr.Button("Calculate")
162
  check = gr.Button("Check Filtered Data")
163
  filtered_data = gr.Textbox(lines=5, label="Filtered Data")
164
- plot_fn = partial(plt_plot, "check_language_criteria")
165
  calculate.click(plot_fn, [dataset, threshold], plot)
166
- check_fn = partial(check_filtered, "check_language_criteria")
167
  check.click(check_fn, [dataset, threshold], filtered_data)
168
 
169
  if __name__ == "__main__":
 
47
  "check_flagged_words_criteria": np.array(ds["check_flagged_words_criteria"]),
48
  "check_stop_word_ratio_criteria": np.array(ds["check_stop_word_ratio_criteria"]),
49
  "check_perplexity_criteria": np.array(ds["check_perplexity_criteria"]),
50
+ "check_compression_ratio_criteria": np.array(ds["check_compression_ratio_criteria"]),
51
  }
52
 
53
  def plt_plot(criteria, dataset, threshold):
 
155
  check_fn = partial(check_filtered, "check_perplexity_criteria")
156
  check.click(check_fn, [dataset, threshold], filtered_data)
157
 
158
+ with gr.Tab("Compression Ratio Criteria"):
159
  plot = gr.Plot()
160
  threshold = gr.Slider(minimum=0, maximum=1, label="Threshold")
161
  calculate = gr.Button("Calculate")
162
  check = gr.Button("Check Filtered Data")
163
  filtered_data = gr.Textbox(lines=5, label="Filtered Data")
164
+ plot_fn = partial(plt_plot, "check_compression_ratio_criteria")
165
  calculate.click(plot_fn, [dataset, threshold], plot)
166
+ check_fn = partial(check_filtered, "check_compression_ratio_criteria")
167
  check.click(check_fn, [dataset, threshold], filtered_data)
168
 
169
  if __name__ == "__main__":