Dataset Viewer
Auto-converted to Parquet Duplicate
json_schema
stringclasses
1 value
unique_id
stringclasses
1 value
{ "additionalProperties": false, "definitions": { "event": { "additionalProperties": false, "properties": { "name": { "description": "Event name", "type": "string" }, "params": { "items": { "$ref": "#/definitions/param" }, "minItems": 0, "type": "array", "_uniqueItems": false } }, "type": "object" }, "param": { "additionalProperties": false, "properties": { "doc": { "description": "parameter documentation", "type": "string" }, "name": { "type": "string" }, "nullable": { "type": "boolean" }, "since": { "$ref": "#/definitions/since" }, "type": { "enum": [ "boolean", "byte", "int", "long", "UUID", "enum", "byteArray", "longArray", "String", "Data", "EntryList_Integer_UUID", "EntryList_Integer_Long", "EntryList_Integer_Integer", "List_Integer", "List_Long", "List_UUID", "Address", "CacheEventData", "DistributedObjectInfo", "Member", "QueryCacheEventData", "RaftGroupId", "ScheduledTaskHandler", "SimpleEntryView", "WanReplicationRef", "Xid", "CacheConfigHolder", "CacheSimpleEntryListenerConfig", "EventJournalConfig", "EvictionConfigHolder", "HotRestartConfig", "ListenerConfigHolder", "AttributeConfig", "IndexConfig", "MapStoreConfigHolder", "MerkleTreeConfig", "NearCacheConfigHolder", "NearCachePreloaderConfig", "PredicateConfigHolder", "QueryCacheConfigHolder", "QueueStoreConfigHolder", "RingbufferStoreConfigHolder", "TimedExpiryPolicyFactoryConfig", "DurationConfig", "ClientBwListEntry", "EntryList_String_String", "EntryList_String_byteArray", "EntryList_Long_byteArray", "EntryList_String_EntryList_Integer_Long", "EntryList_UUID_Long", "EntryList_Address_List_Integer", "EntryList_UUID_Address", "EntryList_Data_Data", "EntryList_Member_List_ScheduledTaskHandler", "List_Address", "List_byteArray", "List_CacheEventData", "List_CacheSimpleEntryListenerConfig", "List_Data", "ListCN_Data", "List_DistributedObjectInfo", "List_ListenerConfigHolder", "List_AttributeConfig", "List_IndexConfig", "List_MemberInfo", "List_QueryCacheConfigHolder", "List_QueryCacheEventData", "List_ScheduledTaskHandler", "List_String", "List_Xid", "List_StackTraceElement", "List_ClientBwListEntry", "List_MCEvent", "Map_String_String", "MergePolicyConfig", "MemberVersion", "MemberInfo", "MCEvent", "AnchorDataListHolder", "PagingPredicateHolder" ] } }, "required": [ "name", "type", "nullable", "since", "doc" ], "type": "object" }, "since": { "default": 2.0, "enum": [ 2.0 ] } }, "properties": { "id": { "description": "Service unique id, 0-255", "maximum": 255, "minimum": 0, "type": "integer" }, "methods": { "items": { "additionalProperties": false, "properties": { "doc": { "description": "method documentation", "type": "string" }, "events": { "items": { "$ref": "#/definitions/event" }, "minItems": 1, "type": "array", "_uniqueItems": true }, "id": { "description": "Method unique id, 1-255", "maximum": 255, "minimum": 1, "type": "integer" }, "name": { "description": "Method name", "type": "string" }, "request": { "additionalProperties": false, "description": "Request message definition", "properties": { "params": { "items": { "$ref": "#/definitions/param" }, "minItems": 0, "type": "array", "_uniqueItems": false }, "partitionIdentifier": { "description": "How should the partition Id calculated for this request. Used in documentation.", "type": [ "integer", "string" ] }, "retryable": { "description": "Is the request retryable or not", "type": "boolean" } }, "required": [ "retryable", "partitionIdentifier" ], "type": "object" }, "response": { "additionalProperties": false, "properties": { "params": { "items": { "$ref": "#/definitions/param" }, "minItems": 0, "type": "array", "_uniqueItems": false } }, "type": "object" }, "since": { "$ref": "#/definitions/since" } }, "required": [ "name", "since", "doc", "request", "response" ] }, "type": "array" }, "name": { "description": "Service name", "type": "string" } }, "required": [ "name", "methods" ], "title": "Hazelcast Client Protocol Definition", "type": "object" }
o61349

This is a pruned eval dataset from epfl-dlab/JSONSchemaBench for personal debugging purposes.

Below is the original model card.


JSONSchemaBench

Paper GitHub

JSONSchemaBench is a benchmark of real-world JSON schemas designed to evaluate structured output generation for Large Language Models (LLMs). It contains approximately 10,000 JSON schemas, capturing diverse constraints and complexities.

import datasets
from datasets import load_dataset

def main():
    # Inspect the available subsets of the dataset
    all_subsets = datasets.get_dataset_config_names("epfl-dlab/JSONSchemaBench")
    print("Available subsets:", all_subsets)
    # Example output: ['Github_easy', 'Github_hard', 'Github_medium', 'Github_trivial', 'Github_ultra', 'Glaiveai2K', 'JsonSchemaStore', 'Kubernetes', 'Snowplow', 'WashingtonPost', 'default']

    # Access a specific subset of the dataset
    subset_name = "Github_easy"
    github_easy = load_dataset("epfl-dlab/JSONSchemaBench", subset_name)
    print(f"Loaded subset '{subset_name}':", github_easy)

    # Load the entire dataset as a whole
    entire_dataset = load_dataset("epfl-dlab/JSONSchemaBench", "default")
    print("Loaded entire dataset:", entire_dataset)

if __name__ == "__main__":
    main()

Update (March 31st, 2025)

To improve inference efficiency and streamline data collation, we’ve decided to drop a small number of exceptionally long samples from the dataset.

We’re using the meta-llama/Llama-3.2-1B-instruct tokenizer, and the filtering criteria are as follows:

  • Github_easy: Samples longer than 1024 tokens β€” 5 out of 582 removed
  • Github_medium: Samples longer than 2048 tokens β€” 7 out of 593 removed
  • Github_hard: Samples longer than 8192 tokens β€” 4 out of 372 removed
  • Other subsets are not touched

Since the number of discarded samples is minimal, this change is expected to have at most a 1% impact on results.

⚠️ Important Update (March 10th, 2025)

We have restructured the dataset to include train/val/test splits. If you downloaded the dataset before this date, you might encounter errors like KeyError: 'Github_easy'.

To fix this issue, please follow one of the options below:

  1. Update How Subsets Are Accessed: If you previously used:
from datasets import load_dataset, concatenate_datasets, DatasetDict, Dataset

subset: DatasetDict = load_dataset("epfl-dlab/JSONSchemaBench")
subset["Github_easy"]

You can update it to:

from datasets import load_dataset, concatenate_datasets, DatasetDict, Dataset

subset: DatasetDict = load_dataset("epfl-dlab/JSONSchemaBench", name="Github_easy")
subset: Dataset = concatenate_datasets([subset["train"], subset["val"], subset["test"]])
  1. Load the Dataset in the Old Structure: If you need the previous structure, you can use a specific revision:
dataset = load_dataset("epfl-dlab/JSONSchemaBench", revision="e2ee5fdba65657c60d3a24b321172eb7141f8d73")

We apologize for the inconvenience and appreciate your understanding! 😊

πŸ“Œ Dataset Overview

  • Purpose: Evaluate the efficiency and coverage of structured output generation.
  • Sources: GitHub, Kubernetes, API specifications, curated collections.
  • Schemas: Categorized based on complexity and domain.

πŸ“Š Dataset Breakdown

Dataset Category Count
GlaiveAI-2K Function Call 1707
Github-Trivial Misc 444
Github-Easy Misc 1943
Snowplow Operational API 403
Github-Medium Misc 1976
Kubernetes Kubernetes API 1064
Washington Post Resource Access API 125
Github-Hard Misc 1240
JSONSchemaStore Misc 492
Github-Ultra Misc 164
Total 9558

πŸ“₯ Loading the Dataset

from datasets import load_dataset

dataset = load_dataset("epfl-dlab/JSONSchemaBench")
print(dataset)

πŸ” Data Structure

Each dataset split contains:

  • "json_schema": The schema definition.
  • "unique_id": A unique identifier for the schema.

πŸš€ For more details, check out the paper.

πŸ“š Citation

@misc{geng2025jsonschemabench,
      title={Generating Structured Outputs from Language Models: Benchmark and Studies},
      author={Saibo Geng et al.},
      year={2025},
      eprint={2501.10868},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2501.10868}
}

License

This dataset is provided under the MIT License. Please ensure that you comply with the license terms when using or distributing this dataset.

Acknowledgements

We would like to thank the contributors and maintainers of the JSON schema projects and the open-source community for their invaluable work and support.

Downloads last month
35

Paper for Casual-Autopsy/JSONSchemaBench