Skip to content

Commit b54a935

Browse files
committed
Read tasks using sota_extractor
1 parent 6a8b3d7 commit b54a935

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

label_tables.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env python
2+
3+
import fire
4+
from sota_extractor.taskdb import TaskDB
5+
6+
def get_sota_tasks(filename):
7+
db = TaskDB()
8+
db.load_tasks(filename)
9+
return db.tasks_with_sota()
10+
11+
12+
def label_tables(tasksfile):
13+
tasks = get_sota_tasks(tasksfile)
14+
for task in tasks:
15+
for dataset in task.datasets:
16+
for row in dataset.sota.rows:
17+
if 'arxiv.org' in row.paper_url:
18+
for metric in row.metrics:
19+
print((task.name, dataset.name, metric, row.model_name, row.metrics[metric], row.paper_url))
20+
21+
22+
if __name__ == "__main__": fire.Fire(label_tables)

0 commit comments

Comments
 (0)