- Jupyter Notebook 95.5%
- HTML 2.5%
- Python 1.8%
- JavaScript 0.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
## What this changes Fixes the examples in the "Data Use Conditions" section of `docs/croissant-spec-1.1.md` (DUO, ODRL, MONDO). Only that section is touched. ## Fixes to errors in the current examples - **Block 2: example contradicted its text.** The text says General Research Use (`DUO_0000042`); the JSON used `duo:0000006` (health, medical or biomedical research, a narrower term). - **Block 3: wrong disease.** `MONDO_0005070` is "neoplasm", not Alzheimer disease. Now `MONDO_0004975`, in both the text and the JSON. - **Non-commercial modifier.** The text and JSON used `DUO_0000018`, the umbrella term that also covers not-for-profit-organisation use. Now `DUO_0000046` (non-commercial use only), which matches the "Non-commercial use only" label. - **ODRL constraints had no `odrl:leftOperand`.** ODRL requires a left operand, an operator and a right operand. - **`duo` and `mondo` prefixes did not expand.** Their IRIs end in `_`, so JSON-LD 1.1 only treats them as prefixes with `"@prefix": true`. Without it `duo:0000042` stays a plain string. - **`"url": "duo:0000042"` in Block 1.** A CURIE in a plain string property is not expanded. Now the full IRI, plus `inDefinedTermSet`. - **`@vocab` was `https://schema.org/`**; the rest of the spec uses `http://schema.org/`. They are different IRIs. - **Missing ODRL requirements:** a policy `@id` (uid), `odrl:assigner` and `odrl:target`, and `odrl:profile`. - **Missing Croissant properties** in the fragments: `dct:conformsTo`, `license`, `creator`, `datePublished`. - Typo: "General Research Use" (double space). ## Design change: how DUO is expressed in ODRL Uses only existing terms, no new vocabulary: - The action is `odrl:use`. A DUO permission describes a research purpose, not an ODRL action, and a custom action would need declaring in a profile. - The DUO permission is the right operand of an `odrl:purpose` constraint, with `odrl:isA`, so a narrower purpose (for example health research under general research use) also qualifies. - The non-commercial modifier is an `odrl:prohibition` of `odrl:commercialize`, with `dct:source` pointing to `DUO_0000046`. ODRL has no "is not a" operator, so a prohibition is the closest fit. - Disease restriction keeps `duo:0000010` as the left operand with `odrl:isA` and a MONDO class. This follows the pattern in the DUODRL work (DUO expressed in ODRL), which is not a standard. Happy to split this into a separate PR if the fixes above should merge first. ## Added prose - Description of the action, purpose constraint, prohibition and `odrl:profile`. - A note on `"@prefix": true`. - A short paragraph on alignment with DUO and similar vocabularies, mentioning the W3C ODRL Community Group's draft [ODRL Profile: AI Vocabulary](https://w3c.github.io/odrl/ai-vocab/) (a draft Community Group report, not a W3C Standard). ## Open points for reviewers - `odrl:profile` uses a placeholder IRI in the examples; ODRL requires a profile IRI once terms beyond the Core Vocabulary are used. - The extra Croissant properties make the fragments longer; they can be dropped if shorter fragments are preferred. - `odrl:isA` is the closest ODRL operator to "this class or a narrower one"; it is not a formal subclass test. ## Checks done Each example parses as JSON, expands under JSON-LD 1.1 with no unexpanded prefixes, and has the ODRL structure described above. DUO and MONDO identifiers were checked against the ontologies. Meem Arafat Manab Ghent, BE, 09.10.2026 --------- Co-authored-by: Joan Giner <giner.joan@gmail.com> Co-authored-by: Omar Benjelloun <benjelloun@users.noreply.github.com> |
||
| .devcontainer | ||
| .github | ||
| .vscode | ||
| croissant-rdf | ||
| datasets | ||
| docs | ||
| eclair | ||
| editor | ||
| health | ||
| python/mlcroissant | ||
| tasks | ||
| .gitignore | ||
| _config.yml | ||
| CONTRIBUTING.md | ||
| gen_pages.py | ||
| LICENSE.md | ||
| mkdocs.yml | ||
| README.md | ||
| requirements.txt | ||
Croissant 🥐
Summary
Croissant 🥐 is a high-level format for machine learning datasets that combines metadata, resource file descriptions, data structure, and default ML semantics into a single file; it works with existing datasets to make them easier to find, use, and support with tools. Croissant builds on schema.org, and its Dataset vocabulary, a widely used format to represent datasets on the Web, and make them searchable. You can find a gentle introduction in the companion paper Croissant: A Metadata Format for ML-Ready Datasets.
Trying It Out
Croissant is currently under development by the community. You can try the Croissant implementation, mlcroissant:
Installation (requires Python 3.10+):
pip install mlcroissant
Loading an example dataset:
import mlcroissant as mlc
ds = mlc.Dataset("https://raw.githubusercontent.com/mlcommons/croissant/main/datasets/1.0/gpt-3/metadata.json")
metadata = ds.metadata.to_json()
print(f"{metadata['name']}: {metadata['description']}")
for x in ds.records(record_set="default"):
print(x)
Use it in your ML workflow:
# 1. Point to a local or remote Croissant file
import mlcroissant as mlc
url = "https://huggingface.co/api/datasets/zalando-datasets/fashion_mnist/croissant"
# 2. Inspect metadata
print(mlc.Dataset(url).metadata.to_json())
# 3. Use Croissant dataset in your ML workload
import tensorflow_datasets as tfds
builder = tfds.core.dataset_builders.CroissantBuilder(
jsonld=url,
record_set_ids=["fashion_mnist"],
file_format='array_record',
)
builder.download_and_prepare()
# 4. Split for training/testing
train, test = builder.as_data_source(split=['default[:80%]', 'default[80%:]'])
Please see the notebook recipes for more examples.
Why a standard format for ML datasets?
Datasets are the source code of machine learning (ML), but working with ML datasets is needlessly hard because each dataset has a unique file organization and method for translating file contents into data structures and thus requires a novel approach to using the data. We need a standard dataset format to make it easier to find and use ML datasets and especially to develop tools for creating, understanding, and improving ML datasets.
The Croissant Format
Croissant 🥐 is a high-level format for machine learning datasets. Croissant brings together four rich layers (in a tasty manner, we hope 😉):
- Metadata: description of the dataset, including responsible ML aspects
- Resources: one or more files or other sources containing the raw data
- Structure: how the raw data is combined and arranged into data structures for use
- ML semantics: how the data is most often used in an ML context
Simple Format Example
Here is an extremely simple example of the Croissant format, with comments showing the four layers. The @context preamble is not included for simplicity. Complete croissant definitions for a wide range of datasets are included in the datasets folder of this repository.
{
"@type": "sc:Dataset",
"name": "minimal_example_with_recommended_fields",
"description": "This is a minimal example, including the required and the recommended fields.",
"license": "https://creativecommons.org/licenses/by/4.0/",
"url": "https://example.com/dataset/recipes/minimal-recommended",
"conformsTo": "http://mlcommons.org/croissant/1.0",
"distribution": [
{
"@type": "cr:FileObject",
"@id": "minimal.csv",
"name": "minimal.csv",
"contentUrl": "data/minimal.csv",
"encodingFormat": "text/csv",
"sha256": "48a7c257f3c90b2a3e529ddd2cca8f4f1bd8e49ed244ef53927649504ac55354"
}
],
"recordSet": [
{
"@type": "cr:RecordSet",
"name": "examples",
"description": "Records extracted from the example table, with their schema.",
"field": [
{
"@type": "cr:Field",
"name": "name",
"description": "The first column contains the name.",
"dataType": "sc:Text",
"source": {
"fileObject": { "@id": "minimal.csv" },
"extract": {
"column": "name"
}
}
},
{
"@type": "cr:Field",
"name": "age",
"description": "The second column contains the age.",
"dataType": "sc:Integer",
"source": {
"fileObject": { "@id": "minimal.csv" },
"extract": {
"column": "age"
}
}
}
]
}
]
}
Resources
- Format Specification (Croissant 1.1)
- Github Repo
- mlcroissant code
- Examples
- Verifier
- Shared Drive
- Requirements Document
- Responsible AI Approach
Getting involved
- Join the mailing list
- Attend Croissant meetings (please joint the list to automatically receive the invite)
- File issues for bugs for feature requests
- Contribute to the code. To merge PRs, you will need to sign the MLCommons Association CLA at: https://mlcommons.org/community/subscribe/
Integrations
- Datasets Search crawls and indexes Croissant JSON-LD files on the web and provides a filter to restrict results to Croissant datasets.
- Kaggle embeds Croissant JSON-LD directly in their HTML, and also provides the following ways to download the Croissant JSON-LD file:
- Via an
Export metadata as Croissantbutton on the dataset's page (ex: https://www.kaggle.com/datasets/unsdsn/world-happiness) - Via download URL (ex: https://www.kaggle.com/datasets/unsdsn/world-happiness/croissant/download)
- Via an
- OpenML offers a
Croissantbutton on all of their datasets to download the underlying Croissant JSON-LD file. - Hugging Face embeds Croissant JSON-LD directly in the HTML of dataset pages. It also offers ways to download the Croissant JSON-LD file:
- Via a
Croissanttag button on the dataset's page (ex: https://huggingface.co/datasets/CohereForAI/aya_collection) - Via their API (ex: https://huggingface.co/api/datasets/CohereForAI/aya_collection/croissant)
- Via a
- TFDS has a
CroissantBuilderto transform any JSON-LD file into a TFDS dataset, which makes it possible to load the data into TensorFlow, JAX and PyTorch. - CKAN supports Croissant through the ckanext-dcat extension starting from version 2.3.0. The metadata is embedded in the dataset's page source and is also accessible through a dedicated endpoint. For datasets imported into the CKAN DataStore, the resources will expose Croissant's RecordSet objects, detailing data fields like column names and types.
- Dataverse offers an addon to export datasets in Croissant format and embed Croissant directly in the HTML of dataset landing pages.
Governance
Croissant is being developed by the community as a Task Force of the MLCommons Association Datasets Working Group. The Task Force is open to anyone (as is the parent Datasets working group). The Task Force is co-chaired by Omar Benjelloun, Elena Simperl, and Joaquin Vanschoren.
Contributors
Albert Villanova (Hugging Face), Andrew Zaldivar (Google), Baishan Guo (Meta), Carole Jean-Wu (Meta), Ce Zhang (ETH Zurich), Costanza Conforti (Google), D. Sculley (Kaggle), Dan Brickley (Schema.Org), Eduardo Arino de la Rubia (Meta), Edward Lockhart (Deepmind), Elena Simperl (King's College London), Goeff Thomas (Kaggle), Joan Giner-Miguelez (UOC), Joaquin Vanschoren (TU/Eindhoven, OpenML), Jos van der Velde (TU/Eindhoven, OpenML), Julien Chaumond (Hugging Face), Kurt Bollacker (MLCommons), Lora Aroyo (Google), Luis Oala (Dotphoton), Meg Risdal (Kaggle), Natasha Noy (Google), Newsha Ardalani (Meta), Omar Benjelloun (Google), Peter Mattson (MLCommons), Pierre Marcenac (Google), Pierre Ruyssen (Google), Pieter Gijsbers (TU/Eindhoven, OpenML), Prabhant Singh (TU/Eindhoven, OpenML), Quentin Lhoest (Hugging Face), Steffen Vogler (Bayer), Taniya Das (TU/Eindhoven, OpenML), Michael Kuchnik (Meta)
Thank you for supporting Croissant! 🙂
Citation
@inproceedings{NEURIPS2024_9547b09b,
author = {Akhtar, Mubashara and Benjelloun, Omar and Conforti, Costanza and Foschini, Luca and Gijsbers, Pieter and Giner-Miguelez, Joan and Goswami, Sujata and Jain, Nitisha and Karamousadakis, Michalis and Krishna, Satyapriya and Kuchnik, Michael and Lesage, Sylvain and Lhoest, Quentin and Marcenac, Pierre and Maskey, Manil and Mattson, Peter and Oala, Luis and Oderinwale, Hamidah and Ruyssen, Pierre and Santos, Tim and Shinde, Rajat and Simperl, Elena and Suresh, Arjun and Thomas, Goeffry and Tykhonov, Slava and Vanschoren, Joaquin and Varma, Susheel and van der Velde, Jos and Vogler, Steffen and Wu, Carole-Jean and Zhang, Luyao},
booktitle = {Advances in Neural Information Processing Systems},
editor = {A. Globerson and L. Mackey and D. Belgrave and A. Fan and U. Paquet and J. Tomczak and C. Zhang},
pages = {82133--82148},
publisher = {Curran Associates, Inc.},
title = {Croissant: A Metadata Format for ML-Ready Datasets},
url = {https://proceedings.neurips.cc/paper_files/paper/2024/file/9547b09b722f2948ff3ddb5d86002bc0-Paper-Datasets_and_Benchmarks_Track.pdf},
volume = {37},
year = {2024}
}
Licensing
- Croissant implementation and examples are licensed under Apache 2.
- Croissant specification© 2024-2026 by MLCommons Association and contributors is licensed under CC BY-ND 4.0
Note: The CC BY-ND license was selected to facilitate widespread adoption and use of the Croissant specification while maintaining a canonical reference version. However, this license can raise questions around what downstream uses are permissible. MLCommons wants to assure all prospective users that they are free to remix and adapt the Croissant specification for their internal use. If users want to distribute something they have created based on or that adds to the specification, they can as long as the Croissant specification is referenced through a link, (i.e., not incorporated directly) and the specification itself isn't changed. Just remember to include the attribution. Don’t hesitate to reach out if you have any questions.