ranpox commited on
Commit
cb0c38e
1 Parent(s): 542cb74

update app

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -5,6 +5,16 @@ import gradio as gr
5
  file_path = 'iclr2024_reviews_20231110.csv'
6
  df = pd.read_csv(file_path)
7
 
 
 
 
 
 
 
 
 
 
 
8
  # Define a function to filter the DataFrame based on a search query
9
  def search_papers(query=""):
10
  if query: # If there is a search query, filter the DataFrame
@@ -18,7 +28,7 @@ with gr.Blocks() as demo:
18
  search_bar = gr.Textbox(placeholder="Enter search terms here...", label="Search Reviews")
19
 
20
  # Initialize the reviews table with all the data
21
- reviews_table = gr.Dataframe(df)
22
 
23
  # When the search bar changes, update the reviews table with the filtered results
24
  search_bar.change(
 
5
  file_path = 'iclr2024_reviews_20231110.csv'
6
  df = pd.read_csv(file_path)
7
 
8
+ # Function to create a hyperlink for the paper title
9
+ def create_link(row):
10
+ base_url = "https://openreview.net/forum?id="
11
+ title = row['Title']
12
+ paper_id = row['ID']
13
+ return f'<a href="{base_url}{paper_id}" target="_blank">{title}</a>'
14
+
15
+ # Apply the function to create hyperlinks in the Title column
16
+ df['Title'] = df.apply(create_link, axis=1)
17
+
18
  # Define a function to filter the DataFrame based on a search query
19
  def search_papers(query=""):
20
  if query: # If there is a search query, filter the DataFrame
 
28
  search_bar = gr.Textbox(placeholder="Enter search terms here...", label="Search Reviews")
29
 
30
  # Initialize the reviews table with all the data
31
+ reviews_table = gr.Dataframe(df, interactive=True, type="pandas", datatype=["str", "str", "html", "number", "number", "str"])
32
 
33
  # When the search bar changes, update the reviews table with the filtered results
34
  search_bar.change(