forked from Shad0wwa1ker/OpenICLR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
72 lines (55 loc) · 1.93 KB
/
Copy pathexample.py
File metadata and controls
72 lines (55 loc) · 1.93 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
"""
使用示例
演示如何使用ICLR爬虫
"""
from iclr_scraper import ICLRScraper
from data_storage import DataStorage
# 示例1: 爬取ICLR 2024的完整数据
def example_full_scrape():
"""爬取完整数据(论文+评审+审稿人)"""
scraper = ICLRScraper(delay=1.0) # 设置1秒延迟
storage = DataStorage(output_dir="data")
# 爬取2024年数据
data = scraper.scrape_iclr_data(
year=2024,
include_reviews=True,
include_reviewers=True
)
# 保存数据
storage.save_iclr_data(data, 2024)
print(f"爬取完成!论文数: {data['total_papers']}")
# 示例2: 只爬取论文数据(不包含评审和审稿人)
def example_papers_only():
"""只爬取论文数据"""
scraper = ICLRScraper(delay=1.0)
storage = DataStorage(output_dir="data")
data = scraper.scrape_iclr_data(
year=2024,
include_reviews=False,
include_reviewers=False
)
storage.save_iclr_data(data, 2024)
# 示例3: 获取单篇论文的详细信息
def example_single_paper():
"""获取单篇论文的详细信息"""
scraper = ICLRScraper()
# 获取论文列表
submissions = scraper.get_iclr_submissions(year=2024, limit=10)
if submissions:
# 获取第一篇论文的详细信息
paper_id = submissions[0]['id']
print(f"论文ID: {paper_id}")
print(f"标题: {submissions[0].get('content', {}).get('title', '')}")
# 获取评审
reviews = scraper.get_reviews(paper_id)
print(f"评审数量: {len(reviews)}")
# 获取决策
decision = scraper.get_decision(paper_id)
if decision:
print(f"决策: {decision.get('content', {}).get('decision', '')}")
if __name__ == '__main__':
# 运行示例(取消注释以运行)
# example_full_scrape()
# example_papers_only()
# example_single_paper()
pass