Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -212,10 +212,11 @@ with gr.Blocks(fill_width=True) as demo:
|
|
| 212 |
3. Then, choose a BERT classifier model from the drop down.\n
|
| 213 |
4. Finally, click the 'start prediction' buttton.\n
|
| 214 |
""")
|
| 215 |
-
with gr.
|
| 216 |
-
with gr.
|
| 217 |
-
with gr.
|
| 218 |
T_file_input = gr.File(label="Upload CSV or TSV File", file_types=['.tsv', '.csv'])
|
|
|
|
| 219 |
T_text_field = gr.Textbox(label="Text field name", value="tweet_text")
|
| 220 |
T_event_model = gr.Dropdown(event_models, value=event_models[0], label="Select classification model")
|
| 221 |
with gr.Accordion("Prediction threshold", open=False):
|
|
@@ -223,13 +224,13 @@ with gr.Blocks(fill_width=True) as demo:
|
|
| 223 |
info="This value sets a threshold by which texts classified flood or fire are accepted, \
|
| 224 |
higher values makes the classifier stricter (CAUTION: A value of 1 will set all predictions as none)", interactive=True)
|
| 225 |
T_predict_button = gr.Button("Start Prediction")
|
| 226 |
-
|
|
|
|
| 227 |
T_data_filter = gr.Dropdown(visible=False)
|
| 228 |
T_tweet_embed = gr.HTML("<h1>Select a Tweet ID to view Tweet</h1>", container=True, every=1.0)
|
| 229 |
|
| 230 |
with gr.Column(scale=6):
|
| 231 |
T_data = gr.DataFrame(headers=["Texts", "event_label", "model_score", "IDs"],
|
| 232 |
-
row_count=(10, 'dynamic'),
|
| 233 |
wrap=True,
|
| 234 |
show_fullscreen_button=True,
|
| 235 |
show_copy_button=True,
|
|
|
|
| 212 |
3. Then, choose a BERT classifier model from the drop down.\n
|
| 213 |
4. Finally, click the 'start prediction' buttton.\n
|
| 214 |
""")
|
| 215 |
+
with gr.Group():
|
| 216 |
+
with gr.Row(equal_height=True):
|
| 217 |
+
with gr.Column():
|
| 218 |
T_file_input = gr.File(label="Upload CSV or TSV File", file_types=['.tsv', '.csv'])
|
| 219 |
+
with gr.Column():
|
| 220 |
T_text_field = gr.Textbox(label="Text field name", value="tweet_text")
|
| 221 |
T_event_model = gr.Dropdown(event_models, value=event_models[0], label="Select classification model")
|
| 222 |
with gr.Accordion("Prediction threshold", open=False):
|
|
|
|
| 224 |
info="This value sets a threshold by which texts classified flood or fire are accepted, \
|
| 225 |
higher values makes the classifier stricter (CAUTION: A value of 1 will set all predictions as none)", interactive=True)
|
| 226 |
T_predict_button = gr.Button("Start Prediction")
|
| 227 |
+
with gr.Row():
|
| 228 |
+
with gr.Column(scale=4):
|
| 229 |
T_data_filter = gr.Dropdown(visible=False)
|
| 230 |
T_tweet_embed = gr.HTML("<h1>Select a Tweet ID to view Tweet</h1>", container=True, every=1.0)
|
| 231 |
|
| 232 |
with gr.Column(scale=6):
|
| 233 |
T_data = gr.DataFrame(headers=["Texts", "event_label", "model_score", "IDs"],
|
|
|
|
| 234 |
wrap=True,
|
| 235 |
show_fullscreen_button=True,
|
| 236 |
show_copy_button=True,
|