Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,14 +51,14 @@ with gr.Blocks() as demo:
|
|
| 51 |
# T4.5 Relevance Classifier Demo
|
| 52 |
This is a demo created to explore floods and wildfire classification in social media posts.\n
|
| 53 |
Usage:\n
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
Evaluation:\n
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
""")
|
| 63 |
with gr.Row(equal_height=True):
|
| 64 |
with gr.Column(scale=4):
|
|
@@ -86,15 +86,21 @@ with gr.Blocks() as demo:
|
|
| 86 |
predict_button.click(load_and_analyze_csv, inputs=[file_input, text_field, event_model],
|
| 87 |
outputs=[flood_checkbox_output, fire_checkbox_output, none_checkbox_output, model_confidence])
|
| 88 |
|
| 89 |
-
gr.
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
with gr.Tab("Question Answering"):
|
| 100 |
# XXX Add some button disabling here, if the classification process is not completed first XXX
|
|
|
|
| 51 |
# T4.5 Relevance Classifier Demo
|
| 52 |
This is a demo created to explore floods and wildfire classification in social media posts.\n
|
| 53 |
Usage:\n
|
| 54 |
+
\tUpload .tsv data file (must contain a text column with social media posts).\n
|
| 55 |
+
\tNext, type the name of the text column.\n
|
| 56 |
+
\tThen, choose a BERT classifier model from the drop down.\n
|
| 57 |
+
\tFinally, click the 'start classification' buttton.\n
|
| 58 |
Evaluation:\n
|
| 59 |
+
\tTo evaluate the model's accuracy select the INCORRECT classifications using the checkboxes in front of each post.\n
|
| 60 |
+
\tThen, click on the 'Calculate Accuracy' button.\n
|
| 61 |
+
\tThen, click on the 'Download data as CSV' to get the classifications and evaluation data as a .csv file.
|
| 62 |
""")
|
| 63 |
with gr.Row(equal_height=True):
|
| 64 |
with gr.Column(scale=4):
|
|
|
|
| 86 |
predict_button.click(load_and_analyze_csv, inputs=[file_input, text_field, event_model],
|
| 87 |
outputs=[flood_checkbox_output, fire_checkbox_output, none_checkbox_output, model_confidence])
|
| 88 |
|
| 89 |
+
with gr.Row(equal_height=True):
|
| 90 |
+
with gr.Column(scale=6):
|
| 91 |
+
gr.Markdown(r"""
|
| 92 |
+
Accuracy: is the model's ability to make correct predicitons.
|
| 93 |
+
It is the fraction of correct prediction out of the total predictions.
|
| 94 |
+
$
|
| 95 |
+
\text{Accuracy} = \frac{\text{Correct predictions}}{\text{All predictions}} * 100
|
| 96 |
+
$
|
| 97 |
+
Model Confidence: is the mean probabilty of each case
|
| 98 |
+
belonging to their assigned classes. A value of 1 is best.
|
| 99 |
+
""", latex_delimiters=[{ "left": "$", "right": "$", "display": True }])
|
| 100 |
+
with gr.Column(scale=4):
|
| 101 |
+
correct = gr.Number(label="Number of correct classifications", value=0)
|
| 102 |
+
incorrect = gr.Number(label="Number of incorrect classifications", value=0)
|
| 103 |
+
accuracy = gr.Number(label="Model Accuracy", value=0)
|
| 104 |
|
| 105 |
with gr.Tab("Question Answering"):
|
| 106 |
# XXX Add some button disabling here, if the classification process is not completed first XXX
|