-
Notifications
You must be signed in to change notification settings - Fork 0
/
iclr_before_24_openreview_crawl.py
56 lines (41 loc) · 1.54 KB
/
iclr_before_24_openreview_crawl.py
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import requests
import openreview
import pandas as pd
from tqdm import tqdm
conf_year = input("Put Conference Year: ")
venue_id = f"ICLR.cc/{conf_year}/Conference/"
client = openreview.Client(baseurl='https://api.openreview.net')
# Single-blind venues
# API V1 (Double Blind Submissions)
submissions = client.get_all_notes(invitation=f"{venue_id}-/Blind_Submission")
api_key = ...
url = "https://api.scrapingdog.com/google_scholar"
params = {
"api_key": api_key,
"query": "",
}
paper_titles = []
citation_statistics = []
for submission in tqdm(submissions):
if "Submitted" in submission.content["venue"]:
continue
else:
paper_title = submission.content["title"]
paper_titles.append(paper_title)
params["query"] = "intitle:"+paper_title
response = requests.get(url, params=params)
while(response.status_code != 200):
response = requests.get(url, params=params)
data = response.json()
try:
if data['scholar_results'][0]['inline_links']['cited_by']['total'] == 'Related articles':
citation_statistics.append(0)
else:
_, _, val = data['scholar_results'][0]['inline_links']['cited_by']['total'].split(" ")
citation_statistics.append(int(val))
except:
citation_statistics.append(-1)
stats = {'name': paper_titles, 'num_citation': citation_statistics}
df = pd.DataFrame(stats)
df = df.sort_values(by=['num_citation'], ascending=False)
df.to_csv(f'ICLR-{conf_year}-citation_stats.csv')