akhaliq HF Staff commited on
Commit
d29854e
·
1 Parent(s): 05313cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
- table = """<div class="grid grid-cols-4 gap-4">
 
3
  <table border="1">
4
  <tbody>
5
  <tr><th>Paper</th><th>Code</th><th>Gradio Demo</th><th>Hugging Face Model</th><th>Hugging Face Dataset</th></tr>
@@ -699,10 +700,11 @@ table = """<div class="grid grid-cols-4 gap-4">
699
  <tr><td>Identifying Corporate Credit Risk Sentiments from Financial News Noujoud Ahbali, Xinyuan Liu, Albert Aristotle Nanda, Jamie Stark, Ashit Talukder, Rupinder Paul Khandpur</td></tr>
700
  </tbody>
701
  </table>
702
- </div>
703
  """
704
  def update():
705
- return table
 
 
706
 
707
  block = gr.Blocks()
708
 
@@ -711,7 +713,7 @@ with block:
711
  with gr.Tabs():
712
  with gr.TabItem("NAACL papers list"):
713
  with gr.Row():
714
- data = gr.HTML()
715
  with gr.Row():
716
  data_run = gr.Button("Refresh")
717
  data_run.click(update, inputs=None, outputs=data)
 
1
  import gradio as gr
2
+ import pandas as pd
3
+ table = """
4
  <table border="1">
5
  <tbody>
6
  <tr><th>Paper</th><th>Code</th><th>Gradio Demo</th><th>Hugging Face Model</th><th>Hugging Face Dataset</th></tr>
 
700
  <tr><td>Identifying Corporate Credit Risk Sentiments from Financial News Noujoud Ahbali, Xinyuan Liu, Albert Aristotle Nanda, Jamie Stark, Ashit Talukder, Rupinder Paul Khandpur</td></tr>
701
  </tbody>
702
  </table>
 
703
  """
704
  def update():
705
+ tables = pd.read_html(table,header=0)
706
+ papers_table = tables[0]
707
+ return papers_table
708
 
709
  block = gr.Blocks()
710
 
 
713
  with gr.Tabs():
714
  with gr.TabItem("NAACL papers list"):
715
  with gr.Row():
716
+ data = gr.Dataframe(type="pandas",wrap=True)
717
  with gr.Row():
718
  data_run = gr.Button("Refresh")
719
  data_run.click(update, inputs=None, outputs=data)