hysts HF staff commited on
Commit
42f96d8
1 Parent(s): 3a70a87
Files changed (2) hide show
  1. app.py +3 -0
  2. paper_list.py +9 -1
app.py CHANGED
@@ -57,6 +57,7 @@ with gr.Blocks(css="style.css") as demo:
57
  "Dataset",
58
  ],
59
  )
 
60
  search_button = gr.Button("Search")
61
 
62
  number_of_papers = gr.Textbox(label="Number of Papers Found")
@@ -68,6 +69,7 @@ with gr.Blocks(css="style.css") as demo:
68
  search_box,
69
  case_sensitive,
70
  filter_names,
 
71
  ],
72
  outputs=[
73
  number_of_papers,
@@ -86,6 +88,7 @@ with gr.Blocks(css="style.css") as demo:
86
  search_box,
87
  case_sensitive,
88
  filter_names,
 
89
  ],
90
  outputs=[
91
  number_of_papers,
 
57
  "Dataset",
58
  ],
59
  )
60
+ presentation_type = gr.Radio(label="Presentation Type", choices=["(ALL)", "Oral", "Poster"], value="(ALL)")
61
  search_button = gr.Button("Search")
62
 
63
  number_of_papers = gr.Textbox(label="Number of Papers Found")
 
69
  search_box,
70
  case_sensitive,
71
  filter_names,
72
+ presentation_type,
73
  ],
74
  outputs=[
75
  number_of_papers,
 
88
  search_box,
89
  case_sensitive,
90
  filter_names,
91
+ presentation_type,
92
  ],
93
  outputs=[
94
  number_of_papers,
paper_list.py CHANGED
@@ -65,8 +65,16 @@ class PaperList:
65
  rows.append(row)
66
  self.table["html_table_content"] = rows
67
 
68
- def render(self, search_query: str, case_sensitive: bool, filter_names: list[str]) -> tuple[str, str]:
 
 
 
 
 
 
69
  df = self.table
 
 
70
  if search_query:
71
  if case_sensitive:
72
  df = df[df.title.str.contains(search_query)]
 
65
  rows.append(row)
66
  self.table["html_table_content"] = rows
67
 
68
+ def render(
69
+ self,
70
+ search_query: str,
71
+ case_sensitive: bool,
72
+ filter_names: list[str],
73
+ presentation_type: str,
74
+ ) -> tuple[str, str]:
75
  df = self.table
76
+ if presentation_type != "(ALL)":
77
+ df = df[df.type == presentation_type.lower()]
78
  if search_query:
79
  if case_sensitive:
80
  df = df[df.title.str.contains(search_query)]