File size: 1,144 Bytes
f3dcb90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 json
import requests
import csv

offset = 0
limit = 1000
max_count = 4944

base_url = 'https://api.openreview.net'

all_papers = []
while offset < max_count:
    limit = min(limit, max_count - offset)

    print(offset, limit)
    url = base_url + f"/notes?details=invitation%2Coriginal&offset={offset}&limit={limit}&invitation=ICLR.cc%2F2023%2FConference%2F-%2FBlind_Submission"

    response = requests.get(url)
    papers = json.loads(response.text)['notes']
    all_papers += papers

    offset += limit



with open('iclr_submissions.csv', 'w', encoding='UTF8', newline='') as f:
    header = ['title', 'url', 'pdf', 'tldr', 'abstract', 'keywords']
    writer = csv.writer(f)
    writer.writerow(header)

    for paper in all_papers:
        content = paper['content']

        title = content['title']
        url = f'https://openreview.net/forum?id={paper["forum"]}'
        pdf =  f'https://openreview.net/pdf?id={paper["forum"]}'
        tldr = content.get('TL;DR', '')
        abstract = content['abstract']
        keywords = ', '.join(content['keywords'])

        writer.writerow([title, url, pdf, tldr, abstract, keywords])