Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -280,8 +280,13 @@ with gr.Blocks(fill_width=True) as demo:
|
|
| 280 |
|
| 281 |
QA_run_button = gr.Button("Start QA", interactive=False)
|
| 282 |
hsummary = gr.Textbox(label="Summary")
|
| 283 |
-
|
| 284 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
|
| 286 |
|
| 287 |
# with gr.Tab("Event Type Classification Eval"):
|
|
@@ -365,6 +370,16 @@ with gr.Blocks(fill_width=True) as demo:
|
|
| 365 |
}
|
| 366 |
|
| 367 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 368 |
|
| 369 |
# Test event listeners
|
| 370 |
T_predict_button.click(
|
|
@@ -407,7 +422,7 @@ with gr.Blocks(fill_width=True) as demo:
|
|
| 407 |
outputs=[hsummary, qa_df])
|
| 408 |
|
| 409 |
qa_df.select(T_on_select, None, T_tweetID)
|
| 410 |
-
T_tweetID.change(fn=None, inputs=T_tweetID, outputs=None, js=
|
| 411 |
|
| 412 |
|
| 413 |
# Event listener for single text classification
|
|
|
|
| 280 |
|
| 281 |
QA_run_button = gr.Button("Start QA", interactive=False)
|
| 282 |
hsummary = gr.Textbox(label="Summary")
|
| 283 |
+
|
| 284 |
+
with gr.Group():
|
| 285 |
+
with gr.Row():
|
| 286 |
+
with gr.Column(scale=7):
|
| 287 |
+
qa_df = gr.DataFrame()
|
| 288 |
+
with gr.Column(scale=3):
|
| 289 |
+
qa_tweet_embed = gr.HTML("""<div id="tweet-container2"></div>""")
|
| 290 |
|
| 291 |
|
| 292 |
# with gr.Tab("Event Type Classification Eval"):
|
|
|
|
| 370 |
}
|
| 371 |
|
| 372 |
"""
|
| 373 |
+
|
| 374 |
+
m2_js = """ (x) =>
|
| 375 |
+
{
|
| 376 |
+
reloadTwitterWidgets();
|
| 377 |
+
const tweetContainer = document.getElementById("tweet-container2");
|
| 378 |
+
tweetContainer.innerHTML = "";
|
| 379 |
+
twttr.widgets.createTweet(x,tweetContainer,{theme: 'dark', dnt: true, align: 'center'});
|
| 380 |
+
}
|
| 381 |
+
|
| 382 |
+
"""
|
| 383 |
|
| 384 |
# Test event listeners
|
| 385 |
T_predict_button.click(
|
|
|
|
| 422 |
outputs=[hsummary, qa_df])
|
| 423 |
|
| 424 |
qa_df.select(T_on_select, None, T_tweetID)
|
| 425 |
+
T_tweetID.change(fn=None, inputs=T_tweetID, outputs=None, js=m2_js)
|
| 426 |
|
| 427 |
|
| 428 |
# Event listener for single text classification
|