File size: 1,685 Bytes
542cb74
 
 
 
 
 
 
cb0c38e
 
 
 
 
 
 
 
 
 
542cb74
 
 
 
 
 
 
 
 
 
 
 
 
cb0c38e
542cb74
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import pandas as pd
import gradio as gr

# Load the CSV file
file_path = 'iclr2024_reviews_20231110.csv'
df = pd.read_csv(file_path)

# Function to create a hyperlink for the paper title
def create_link(row):
    base_url = "https://openreview.net/forum?id="
    title = row['Title']
    paper_id = row['ID']
    return f'<a href="{base_url}{paper_id}" target="_blank">{title}</a>'

# Apply the function to create hyperlinks in the Title column
df['Title'] = df.apply(create_link, axis=1)

# Define a function to filter the DataFrame based on a search query
def search_papers(query=""):
    if query:  # If there is a search query, filter the DataFrame
        filtered_df = df[df.apply(lambda row: row.astype(str).str.contains(query, case=False).any(), axis=1)]
        return filtered_df
    return df  # If no query, return the original DataFrame

with gr.Blocks() as demo:
    gr.Markdown("# ICLR 2024 Paper Review Explorer")
    gr.Markdown("Explore and search through the paper reviews for ICLR 2024. The papers are ranked based on their average score and standard deviation. More data and analysis at [GitHub Repository](https://github.com/ranpox/iclr2024-openreview-submissions)")
    search_bar = gr.Textbox(placeholder="Enter search terms here...", label="Search Reviews")
    
    # Initialize the reviews table with all the data
    reviews_table = gr.Dataframe(df, interactive=True, type="pandas", datatype=["str", "str", "html", "number", "number", "str"])

    # When the search bar changes, update the reviews table with the filtered results
    search_bar.change(
        fn=search_papers,
        inputs=search_bar,
        outputs=reviews_table
    )

demo.launch()