Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,8 +36,8 @@ def load_and_analyze_csv(file, text_field, event_model):
|
|
| 36 |
flood_related = gr.CheckboxGroup(choices=df[df["model_label"]=="flood"][text_field].to_list())
|
| 37 |
not_related = gr.CheckboxGroup(choices=df[df["model_label"]=="none"][text_field].to_list())
|
| 38 |
|
| 39 |
-
return flood_related, fire_related, not_related, model_confidence, len(df[text_field].to_list()), df
|
| 40 |
-
|
| 41 |
def analyze_selected_texts(selections):
|
| 42 |
selected_texts = selections
|
| 43 |
|
|
@@ -117,11 +117,10 @@ with gr.Blocks() as demo:
|
|
| 117 |
|
| 118 |
accuracy_button = gr.Button("Calculate Accuracy")
|
| 119 |
num_posts = gr.Number(visible=False)
|
| 120 |
-
|
| 121 |
-
data = gr.DataFrame(headers=cols) #visible=False
|
| 122 |
|
| 123 |
predict_button.click(load_and_analyze_csv, inputs=[file_input, text_field, event_model],
|
| 124 |
-
outputs=[flood_checkbox_output, fire_checkbox_output, none_checkbox_output, model_confidence, num_posts, data
|
| 125 |
accuracy_button.click(calculate_accuracy, inputs=[flood_checkbox_output, fire_checkbox_output, none_checkbox_output, num_posts],
|
| 126 |
outputs=[incorrect, correct, accuracy])
|
| 127 |
|
|
|
|
| 36 |
flood_related = gr.CheckboxGroup(choices=df[df["model_label"]=="flood"][text_field].to_list())
|
| 37 |
not_related = gr.CheckboxGroup(choices=df[df["model_label"]=="none"][text_field].to_list())
|
| 38 |
|
| 39 |
+
return flood_related, fire_related, not_related, model_confidence, len(df[text_field].to_list()), df
|
| 40 |
+
|
| 41 |
def analyze_selected_texts(selections):
|
| 42 |
selected_texts = selections
|
| 43 |
|
|
|
|
| 117 |
|
| 118 |
accuracy_button = gr.Button("Calculate Accuracy")
|
| 119 |
num_posts = gr.Number(visible=False)
|
| 120 |
+
data = gr.DataFrame() #visible=False
|
|
|
|
| 121 |
|
| 122 |
predict_button.click(load_and_analyze_csv, inputs=[file_input, text_field, event_model],
|
| 123 |
+
outputs=[flood_checkbox_output, fire_checkbox_output, none_checkbox_output, model_confidence, num_posts, data])
|
| 124 |
accuracy_button.click(calculate_accuracy, inputs=[flood_checkbox_output, fire_checkbox_output, none_checkbox_output, num_posts],
|
| 125 |
outputs=[incorrect, correct, accuracy])
|
| 126 |
|