tasksource
600+ curated datasets and preprocessings for instant and interchangeable use
Huggingface Datasets is an excellent library, but it lacks standardization, and datasets often require preprocessing work to be used interchangeably.
tasksource streamlines interchangeable datasets usage to scale evaluation or multi-task learning.
Each dataset is standardized to a MultipleChoice, Classification, or TokenClassification template with canonical fields. We focus on discriminative tasks (= with negative examples or classes) for our annotations but also provide a SequenceToSequence template. All implemented preprocessings are in tasks.py or tasks.md. A preprocessing is a function that accepts a dataset and returns the standardized dataset. Preprocessing code is concise and human-readable.
Installation and usage:
pip install tasksource
from tasksource import list_tasks, load_task
df = list_tasks(multilingual=False) # takes some time
for id in df[df.task_type=="MultipleChoice"].id:
dataset = load_task(id) # all yielded datasets can be used interchangeably
Inputs are kept raw by default. When the inputs alone do not say what to predict, an annotation carries a question ("Is this search query a well-formed question?"), exposed as dataset.question; load_task(id, prompted=True) appends it to the inputs, and the instruct and typed-decision recasts use it as their instruction.
Browse the 500+ curated tasks in tasks.md (tasks kept out on purpose, such as evaluation benchmarks, are in parked.py with the reason) (200+ MultipleChoice tasks, 200+ Classification tasks), and feel free to request a new task. Datasets are downloaded to $HF_DATASETS_CACHE (like any Hugging Face dataset), so ensure you have more than 100GB of space available.
You can now also use:
load_dataset("tasksource/data", "glue/rte",max_rows=30_000)
Pretrained models:
Text encoder pretrained on tasksource reached state-of-the-art results: 🤗/deberta-v3-base-tasksource-nli
Tasksource pretraining is notably helpful for RLHF reward modeling or any kind of classification, including zero-shot. You can also find a large and a multilingual version.
tasksource-instruct
The repo also contains some recasting code to convert tasksource datasets to instructions, providing one of the richest instruction-tuning datasets: 🤗/tasksource-instruct-v0
tasksource-label-nli
We also recast all classification tasks as natural language inference, to improve entailment-based zero-shot classification detection: 🤗/zero-shot-label-nli
tasksource-jev-typed-decisions
Tasksource classification, multiple-choice, and vetted token tasks can be recast as
runtime-defined typed decisions (the Jev / System One request format: choice,
score, and noul questions over a state). The canonical representation keeps
the state, instructions, criteria, integer label, and textual answer separate:
🤗 tasksource/tasksource-jev-typed-decisions
The Jev build runbook covers smoke tests, resumable builds, validation, and publication.
from tasksource import load_task, render_typed_decision
dataset = load_task("glue/rte", recast="jev")
request = render_typed_decision(dataset["train"][0], model="openjev")
The canonical conversion is deterministic and does not paraphrase criteria,
except that a final "all/none of the above" becomes "all/none of the other
options". Multiple-choice criteria keep every source option and are permuted per
row, seeded by task, split, and row index, so the gold slot carries no signal;
rows whose options refer to other options by position or letter keep their
order. The published 1M corpus adds explicit, deterministic, low-frequency
subrecasts for label verification (noul), criterion-order invariance, and
manually vetted instruction variation. Every row records its source, normalized
train/dev/test split, and variant. BIG-bench, MMLU, and BLiMP are excluded.
The flat rows carry group_id and question_id; render_typed_decision_group
combines related canonical decisions into one multi-question request.
Publication keeps each source-row group together under the 500k cap and uses
reviewed question and paired-field wording to reduce repeated boilerplate.
Write and use custom preprocessings
from tasksource import MultipleChoice
codah = MultipleChoice('question_propmt',choices_list='candidate_answers',
labels='correct_answer_idx',
dataset_name='codah', config_name='codah')
winogrande = MultipleChoice('sentence',['option1','option2'],'answer',
dataset_name='winogrande',config_name='winogrande_xl',
splits=['train','validation',None]) # test labels are not usable
tasks = [winogrande.load(), codah.load()]) # Aligned datasets (same columns) can be used interchangably
Citation and contact
For more details, refer to this article:
@inproceedings{sileo-2024-tasksource,
title = "tasksource: A Large Collection of {NLP} tasks with a Structured Dataset Preprocessing Framework",
author = "Sileo, Damien",
booktitle = "Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)",
month = may,
year = "2024",
address = "Torino, Italia",
publisher = "ELRA and ICCL",
url = "https://aclanthology.org/2024.lrec-main.1361",
pages = "15655--15684",
}
For help integrating tasksource into your experiments, please contact damien.sileo@inria.fr.
Release files for tasksource 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tasksource-0.1.0.tar.gz | 240.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tasksource-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 414.2 kB
Release files / tasksource-0.1.0.tar.gz
| Download URL | tasksource-0.1.0.tar.gz |
|---|---|
| Size | 240.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b698e62faf3c97312c2fd29133c0508ec1f9b9718683b1e3c6e06fbc8b905e6a
|
|
BLAKE2b-256 checksum How to use checksums |
7318be69cab4aa80a970926210f7bb9d09554d062fa030f37c164989f0db95ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / tasksource-0.1.0-py3-none-any.whl
| Download URL | tasksource-0.1.0-py3-none-any.whl |
|---|---|
| Size | 173.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
05662c7110171679f7f85f9c0be06c61104fe3248fa38cb188a0057ad58b2e1c
|
|
BLAKE2b-256 checksum How to use checksums |
1b5d1a8d643709cc213d96f5a59c37bff55d011d8b87041b662e3698e6b7e52c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|