Spaces:
Running
Running
Update to ICML 2023
Browse files- .pre-commit-config.yaml +3 -2
- .vscode/settings.json +18 -0
- README.md +2 -2
- app.py +58 -56
- paper_list.py +13 -42
- papers.csv +2 -2
- requirements.txt +1 -0
.pre-commit-config.yaml
CHANGED
@@ -20,14 +20,15 @@ repos:
|
|
20 |
- id: docformatter
|
21 |
args: ['--in-place']
|
22 |
- repo: https://github.com/pycqa/isort
|
23 |
-
rev: 5.
|
24 |
hooks:
|
25 |
- id: isort
|
26 |
- repo: https://github.com/pre-commit/mirrors-mypy
|
27 |
-
rev: v0.
|
28 |
hooks:
|
29 |
- id: mypy
|
30 |
args: ['--ignore-missing-imports']
|
|
|
31 |
- repo: https://github.com/google/yapf
|
32 |
rev: v0.32.0
|
33 |
hooks:
|
|
|
20 |
- id: docformatter
|
21 |
args: ['--in-place']
|
22 |
- repo: https://github.com/pycqa/isort
|
23 |
+
rev: 5.12.0
|
24 |
hooks:
|
25 |
- id: isort
|
26 |
- repo: https://github.com/pre-commit/mirrors-mypy
|
27 |
+
rev: v0.991
|
28 |
hooks:
|
29 |
- id: mypy
|
30 |
args: ['--ignore-missing-imports']
|
31 |
+
additional_dependencies: ['types-python-slugify']
|
32 |
- repo: https://github.com/google/yapf
|
33 |
rev: v0.32.0
|
34 |
hooks:
|
.vscode/settings.json
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"python.linting.enabled": true,
|
3 |
+
"python.linting.flake8Enabled": true,
|
4 |
+
"python.linting.pylintEnabled": false,
|
5 |
+
"python.linting.lintOnSave": true,
|
6 |
+
"python.formatting.provider": "yapf",
|
7 |
+
"python.formatting.yapfArgs": [
|
8 |
+
"--style={based_on_style: pep8, indent_width: 4, blank_line_before_nested_class_or_def: false, spaces_before_comment: 2, split_before_logical_operator: true}"
|
9 |
+
],
|
10 |
+
"[python]": {
|
11 |
+
"editor.formatOnType": true,
|
12 |
+
"editor.codeActionsOnSave": {
|
13 |
+
"source.organizeImports": true
|
14 |
+
}
|
15 |
+
},
|
16 |
+
"editor.formatOnSave": true,
|
17 |
+
"files.insertFinalNewline": true
|
18 |
+
}
|
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 🦀
|
4 |
colorFrom: green
|
5 |
colorTo: gray
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.0
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
duplicated_from: ICML2022/ICML2022_papers
|
|
|
1 |
---
|
2 |
+
title: ICML2023 Papers
|
3 |
emoji: 🦀
|
4 |
colorFrom: green
|
5 |
colorTo: gray
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.34.0
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
duplicated_from: ICML2022/ICML2022_papers
|
app.py
CHANGED
@@ -6,65 +6,67 @@ import gradio as gr
|
|
6 |
|
7 |
from paper_list import PaperList
|
8 |
|
9 |
-
DESCRIPTION = '# ICML
|
10 |
-
NOTES = '''
|
11 |
-
- [ICML 2022](https://icml.cc/Conferences/2022/)
|
12 |
-
- [Proceedings](https://proceedings.mlr.press/v162/)
|
13 |
-
'''
|
14 |
-
FOOTER = '<img id="visitor-badge" alt="visitor badge" src="https://visitor-badge.glitch.me/badge?page_id=hysts.icml2022_papers" />'
|
15 |
|
|
|
16 |
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
placeholder=
|
26 |
-
'You can search for titles with regular expressions. e.g. (?<!sur)face'
|
27 |
-
)
|
28 |
-
case_sensitive = gr.Checkbox(label='Case Sensitive')
|
29 |
-
filter_names = gr.CheckboxGroup(choices=[
|
30 |
-
'arXiv',
|
31 |
-
'GitHub',
|
32 |
-
'HF Space',
|
33 |
-
'HF Model',
|
34 |
-
'HF Dataset',
|
35 |
-
],
|
36 |
-
label='Filter')
|
37 |
-
search_button = gr.Button('Search')
|
38 |
-
|
39 |
-
number_of_papers = gr.Textbox(label='Number of Papers Found')
|
40 |
-
table = gr.HTML(show_label=False)
|
41 |
-
|
42 |
-
gr.Markdown(NOTES)
|
43 |
-
gr.Markdown(FOOTER)
|
44 |
-
|
45 |
-
demo.load(paper_list.render,
|
46 |
-
inputs=[
|
47 |
-
search_box,
|
48 |
-
case_sensitive,
|
49 |
-
filter_names,
|
50 |
-
],
|
51 |
-
outputs=[
|
52 |
-
number_of_papers,
|
53 |
-
table,
|
54 |
-
])
|
55 |
-
search_button.click(paper_list.render,
|
56 |
-
inputs=[
|
57 |
-
search_box,
|
58 |
-
case_sensitive,
|
59 |
-
filter_names,
|
60 |
-
],
|
61 |
-
outputs=[
|
62 |
-
number_of_papers,
|
63 |
-
table,
|
64 |
-
])
|
65 |
-
|
66 |
-
demo.launch(enable_queue=True, share=False)
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
|
69 |
-
|
70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
from paper_list import PaperList
|
8 |
|
9 |
+
DESCRIPTION = '# ICML 2023 Papers'
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
paper_list = PaperList()
|
12 |
|
13 |
+
with gr.Blocks(css='style.css') as demo:
|
14 |
+
gr.Markdown(DESCRIPTION)
|
15 |
|
16 |
+
search_box = gr.Textbox(
|
17 |
+
label='Search Title',
|
18 |
+
placeholder=
|
19 |
+
'You can search for titles with regular expressions. e.g. (?<!sur)face'
|
20 |
+
)
|
21 |
+
case_sensitive = gr.Checkbox(label='Case Sensitive')
|
22 |
+
filter_names = gr.CheckboxGroup(choices=[
|
23 |
+
'arXiv',
|
24 |
+
'GitHub',
|
25 |
+
'Space',
|
26 |
+
'Model',
|
27 |
+
'Dataset',
|
28 |
+
],
|
29 |
+
label='Filter')
|
30 |
+
search_button = gr.Button('Search')
|
31 |
|
32 |
+
number_of_papers = gr.Textbox(label='Number of Papers Found')
|
33 |
+
table = gr.HTML(show_label=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
+
demo.load(
|
36 |
+
fn=paper_list.render,
|
37 |
+
inputs=[
|
38 |
+
search_box,
|
39 |
+
case_sensitive,
|
40 |
+
filter_names,
|
41 |
+
],
|
42 |
+
outputs=[
|
43 |
+
number_of_papers,
|
44 |
+
table,
|
45 |
+
],
|
46 |
+
)
|
47 |
|
48 |
+
search_box.submit(
|
49 |
+
fn=paper_list.render,
|
50 |
+
inputs=[
|
51 |
+
search_box,
|
52 |
+
case_sensitive,
|
53 |
+
filter_names,
|
54 |
+
],
|
55 |
+
outputs=[
|
56 |
+
number_of_papers,
|
57 |
+
table,
|
58 |
+
],
|
59 |
+
)
|
60 |
+
search_button.click(
|
61 |
+
fn=paper_list.render,
|
62 |
+
inputs=[
|
63 |
+
search_box,
|
64 |
+
case_sensitive,
|
65 |
+
filter_names,
|
66 |
+
],
|
67 |
+
outputs=[
|
68 |
+
number_of_papers,
|
69 |
+
table,
|
70 |
+
],
|
71 |
+
)
|
72 |
+
demo.queue().launch()
|
paper_list.py
CHANGED
@@ -1,59 +1,31 @@
|
|
1 |
from __future__ import annotations
|
2 |
|
3 |
-
import numpy as np
|
4 |
import pandas as pd
|
5 |
-
import requests
|
6 |
-
from huggingface_hub.hf_api import SpaceInfo
|
7 |
|
8 |
|
9 |
class PaperList:
|
10 |
def __init__(self):
|
11 |
-
self.organization_name = '
|
12 |
self.table = pd.read_csv('papers.csv')
|
13 |
-
self.
|
14 |
|
15 |
self.table_header = '''
|
16 |
<tr>
|
17 |
-
<td width="
|
18 |
-
<td width="
|
19 |
-
<td width="
|
20 |
-
<td width="
|
21 |
-
<td width="
|
22 |
-
<td width="
|
23 |
-
<td width="
|
24 |
-
<td width="4%">HF Datasets</td>
|
25 |
</tr>'''
|
26 |
|
27 |
-
|
28 |
-
def load_space_info(author: str) -> list[SpaceInfo]:
|
29 |
-
path = 'https://huggingface.co/api/spaces'
|
30 |
-
r = requests.get(path, params={'author': author})
|
31 |
-
d = r.json()
|
32 |
-
return [SpaceInfo(**x) for x in d]
|
33 |
-
|
34 |
-
def add_spaces_to_table(self, organization_name: str,
|
35 |
-
df: pd.DataFrame) -> pd.DataFrame:
|
36 |
-
spaces = self.load_space_info(organization_name)
|
37 |
-
name2space = {
|
38 |
-
s.id.split('/')[1].lower(): f'https://huggingface.co/spaces/{s.id}'
|
39 |
-
for s in spaces
|
40 |
-
}
|
41 |
-
df['hf_space'] = df.loc[:, ['hf_space', 'github']].apply(
|
42 |
-
lambda x: x[0] if isinstance(x[0], str) else name2space.get(
|
43 |
-
x[1].split('/')[-1].lower()
|
44 |
-
if isinstance(x[1], str) else '', np.nan),
|
45 |
-
axis=1)
|
46 |
-
return df
|
47 |
-
|
48 |
-
def _preprcess_table(self) -> None:
|
49 |
-
self.table = self.add_spaces_to_table(self.organization_name,
|
50 |
-
self.table)
|
51 |
self.table['title_lowercase'] = self.table.title.str.lower()
|
52 |
|
53 |
rows = []
|
54 |
for row in self.table.itertuples():
|
55 |
-
|
56 |
-
pdf = f'<a href="{row.pdf}" target="_blank">pdf</a>'
|
57 |
arxiv = f'<a href="{row.arxiv}" target="_blank">arXiv</a>' if isinstance(
|
58 |
row.arxiv, str) else ''
|
59 |
github = f'<a href="{row.github}" target="_blank">GitHub</a>' if isinstance(
|
@@ -66,9 +38,8 @@ class PaperList:
|
|
66 |
row.hf_dataset, str) else ''
|
67 |
row = f'''
|
68 |
<tr>
|
69 |
-
<td>{
|
70 |
<td>{row.authors}</td>
|
71 |
-
<td>{pdf}</td>
|
72 |
<td>{arxiv}</td>
|
73 |
<td>{github}</td>
|
74 |
<td>{hf_space}</td>
|
@@ -80,7 +51,7 @@ class PaperList:
|
|
80 |
|
81 |
def render(self, search_query: str, case_sensitive: bool,
|
82 |
filter_names: list[str]) -> tuple[int, str]:
|
83 |
-
df = self.
|
84 |
if search_query:
|
85 |
if case_sensitive:
|
86 |
df = df[df.title.str.contains(search_query)]
|
|
|
1 |
from __future__ import annotations
|
2 |
|
|
|
3 |
import pandas as pd
|
|
|
|
|
4 |
|
5 |
|
6 |
class PaperList:
|
7 |
def __init__(self):
|
8 |
+
self.organization_name = 'ICML2023'
|
9 |
self.table = pd.read_csv('papers.csv')
|
10 |
+
self._preprocess_table()
|
11 |
|
12 |
self.table_header = '''
|
13 |
<tr>
|
14 |
+
<td width="40%">Paper</td>
|
15 |
+
<td width="30%">Authors</td>
|
16 |
+
<td width="6%">arXiv</td>
|
17 |
+
<td width="6%">GitHub</td>
|
18 |
+
<td width="6%">Spaces</td>
|
19 |
+
<td width="6%">Models</td>
|
20 |
+
<td width="6%">Datasets</td>
|
|
|
21 |
</tr>'''
|
22 |
|
23 |
+
def _preprocess_table(self) -> None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
self.table['title_lowercase'] = self.table.title.str.lower()
|
25 |
|
26 |
rows = []
|
27 |
for row in self.table.itertuples():
|
28 |
+
title = f'{row.title}'
|
|
|
29 |
arxiv = f'<a href="{row.arxiv}" target="_blank">arXiv</a>' if isinstance(
|
30 |
row.arxiv, str) else ''
|
31 |
github = f'<a href="{row.github}" target="_blank">GitHub</a>' if isinstance(
|
|
|
38 |
row.hf_dataset, str) else ''
|
39 |
row = f'''
|
40 |
<tr>
|
41 |
+
<td>{title}</td>
|
42 |
<td>{row.authors}</td>
|
|
|
43 |
<td>{arxiv}</td>
|
44 |
<td>{github}</td>
|
45 |
<td>{hf_space}</td>
|
|
|
51 |
|
52 |
def render(self, search_query: str, case_sensitive: bool,
|
53 |
filter_names: list[str]) -> tuple[int, str]:
|
54 |
+
df = self.table
|
55 |
if search_query:
|
56 |
if case_sensitive:
|
57 |
df = df[df.title.str.contains(search_query)]
|
papers.csv
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:b585cf6312b7e58c0801a3a00d83e4dcde09bc99618b5bbd6e73d02e724118f9
|
3 |
+
size 301993
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pandas==2.0.2
|