Datasets:
Download evaluation/dataset.py from DMU-ITREC/SailorEval: direct link, hf CLI and curl.
- Browser
- Download file 653 Bytes
-
https://huggingface.co/datasets/DMU-ITREC/SailorEval/resolve/main/evaluation/dataset.py
- Command line
-
hf download hf://datasets/DMU-ITREC/SailorEval/evaluation/dataset.py
-
curl -L -o dataset.py https://huggingface.co/datasets/DMU-ITREC/SailorEval/resolve/main/evaluation/dataset.py
653 Bytes
| from .io import DATA, load_json, read_jsonl | |
| def select_rows(task_id,subset='full',limit=None): | |
| if subset!='full': | |
| raise ValueError('This release supports the full test set only.') | |
| manifest=load_json(DATA/'manifest.json') | |
| task=next((t for t in manifest['tasks'] if t['id']==task_id),None) | |
| if task is None: raise ValueError('Unknown task: '+task_id) | |
| rows=read_jsonl(DATA/task['path']) | |
| if not rows: raise ValueError(f'No test records found for {task_id} at {task["path"]}') | |
| if limit is not None: | |
| if limit<=0: raise ValueError('--limit must be positive') | |
| rows=rows[:limit] | |
| return manifest,task,rows | |