mlcommons/croissant

repository·main·Indexed 21 days ago

https://github.com/mlcommons/croissant

A high-level metadata format for machine learning datasets that combines metadata, resource descriptions, data structure, and ML semantics into a single JSON-LD file to improve integration across frameworks like TensorFlow, PyTorch, and JAX. The repository includes the croissant-rdf package for generating RDF from Hugging Face and Kaggle datasets, a Croissant Editor, a validator Gradio app, and Eclair agentic tools for dataset discovery.

Tokens
86.5K
Snippets
251
Records
350
Agent score
74%

What's inside Croissant

  1. Overview of Eclair APIs and tools

    main

    Eclair provides multiple interfaces for dataset discovery and management. Depending on your workflow, you can interact with Eclair using:

    • Model Context Protocol (MCP) Tools: For integrating Eclair capabilities into LLM-based agents and environments.
    • REST API: For programmatic access to Eclair services over HTTP.
    • Python SDK: For direct integration into Python-based machine learning workflows.
  2. Overview of Eclair agentic tools

    main
    Eclair is a set of agentic tools designed to help AI models (such as Gemini and Claude) discover, download, and utilize datasets. It enables models to answer questions using factual, structured data from millions of available datasets worldwide, reducing reliance on training data or web searches for scientific and analytical tasks.
  3. Understand the Croissant licensing

    main

    The Croissant project involves two distinct licenses:

    1. Implementation and Examples: Licensed under Apache 2.
    2. Croissant Specification: Licensed under CC BY-ND 4.0.

    Usage notes for the Specification (CC BY-ND 4.0):

    • You are free to remix and adapt the specification for internal use.
    • If you distribute something created based on or adding to the specification, you must reference the specification via a link (do not incorporate the text directly) and include proper attribution.
    • You must not change the specification itself.
  4. Understand the Croissant RAI Specification use cases

    main

    The Croissant Responsible AI (RAI) specification provides a vocabulary for documenting metadata at two levels:

    1. Dataset level: Similar to data cards, these properties describe the overall dataset (e.g., motivation, composition, collection process, and intended uses).
    2. Record level: Granular annotations applied to atomic units (e.g., sentences, images, videos) to capture information like specific demographics, concept extraction, or safety/fairness attributes. These record-level insights are often aggregated to create dataset-level 'score cards' or 'nutrition labels'.

    Key use cases include documenting the data life cycle, labeling processes, participatory data creation, AI safety/fairness evaluation, traceability for explainability, regulatory compliance, and social/cultural inclusion.

  5. What is the Croissant format and why use it?

    main

    Croissant is a metadata format encoded in JSON-LD designed to standardize the description and semantics of Machine Learning (ML) datasets. It provides a vocabulary for dataset attributes that allows for seamless interchange between ML frameworks like PyTorch, TensorFlow, or JAX.

    Key benefits include:

    • Discoverability: Enables dataset search engines and LLMs/AI agents to parse metadata for easier discovery.
    • Portability and Reproducibility: Provides sufficient information for ML tools to load datasets with minimal code, ensuring identical interpretation across different tools.
    • Responsible AI (RAI): Includes machine-actionable mechanisms for data provenance (using W3C PROV-O) and usage conditions (using ODRL) to facilitate responsible data sharing and reuse.
  6. What is GeoCroissant?

    main

    GeoCroissant is an extension of the core Croissant framework specifically designed for geospatial machine learning (Geo-ML) datasets. While standard Croissant provides a foundation for ML metadata, GeoCroissant adds essential geospatial-specific elements required for Earth observation (EO) and GeoAI workflows.

    Key enhancements include:

    • Spatial Context: Support for Coordinate Reference Systems (CRS), spatial resolution, and spatial coverage (e.g., GeoShape).
    • Temporal Information: Standardized temporal coverage and time-series support.
    • Spectral Metadata: Detailed descriptors for sensor bands, including band names, center wavelengths, and bandwidths.
    • Responsible AI: Support for documenting sampling strategies and geospatial biases to improve model reliability.
    • Interoperability: Improved mapping for complex formats like NetCDF, HDF5, and Zarr, making them accessible to frameworks like PyTorch, TensorFlow, Keras, and HuggingFace.
  7. Overview of Eclair Model Context Protocol (MCP) Tools

    main
    Eclair implements the Model Context Protocol (MCP), providing a standardized set of tools that allow AI agents to discover, inspect, and interact with machine learning datasets. These tools enable automated workflows for searching datasets, retrieving Croissant metadata, validating metadata compliance, and downloading datasets for local use.
  8. Overview of Croissant RAI Use Cases and Properties

    main

    The Croissant RAI specification provides properties to address specific Responsible AI (RAI) use cases. The current version (1.0) focuses on several key areas by extending core Croissant and Schema.org properties with new rai: prefixed properties.

    Supported Use Cases

    • The data life cycle: Captures how data is collected, its limitations, and how it is maintained.
    • Data labeling: Details the platforms, tools, and demographics of annotators.
    • Participatory data: Documents the involvement of participants and contributors.
    • AI safety and fairness: Addresses biases, limitations, and sensitive information.
    • Regulatory compliance: Manages sensitive information and data manipulation protocols.

    Note: Use cases for Traceability and Inclusion are identified for future expansion.

  9. What is the Croissant format?

    main

    Croissant 🥐 is a high-level metadata format for machine learning datasets. It is built on top of schema.org and provides a standardized way to describe datasets so they are easily searchable and machine-readable.

    A Croissant file consists of four layers:

    1. Metadata: Descriptions of the dataset and responsible ML aspects.
    2. Resources: Descriptions of the raw data files or sources.
    3. Structure: How raw data is arranged into usable data structures.
    4. ML semantics: How the data is typically used in ML contexts.
  10. Eclair testing strategies

    main

    Eclair employs several testing layers to ensure stability:

    • Unit Tests: Test individual components (like EclairTools) in isolation, often using unittest.mock to patch external dependencies.
    • Integration Tests: Test interactions between components, such as verifying that the server's /mcp endpoint correctly handles tool calls using httpx.AsyncClient.
    • End-to-End (E2E) Tests: Test complete user workflows (e.g., searching for a dataset, downloading it, and retrieving metadata) using the EclairClient.
    • Performance Tests: Test the system under load, such as measuring response times for concurrent searches using AsyncEclairClient and asyncio.gather.
  11. Understand the Croissant RAI Namespaces

    main

    The Croissant RAI specification uses several namespaces to extend the core Croissant and Schema.org vocabularies. When constructing your metadata, use these prefixes and IRIs:

    PrefixIRIDescription
    raihttp://mlcommons.org/croissant/RAI/The Croissant RAI vocabulary namespace
    schttp://schema.org/The schema.org namespace
    crhttp://mlcommons.org/croissant/MLCommons Croissant namespace
  12. Understand GeoCroissant metadata granularity

    main

    GeoCroissant distinguishes between two levels of metadata to support different use cases, such as fairness, safety, and dataset lifecycle management:

    1. Dataset-level metadata: Similar to data cards, these provide high-level descriptions of the entire dataset.
    2. Record-level metadata: Annotations applied to the atomic units of a dataset (e.g., a single sentence, image, video, or conversation). These granular annotations can be aggregated to provide dataset-level insights, such as coverage of specific topics, concepts, or levels of adversariality for safety testing.