leetcode / README.md
lintangsutawika
add training data
aa87ed9
|
Raw History Blame Contribute Delete
1.08 kB
metadata
license: apache-2.0
language:
  - code
task_categories:
  - text-generation

LeetCode multilingual benchmark dataset

Post-interface rows for the msl-multilingual-self-learning benchmark, flattened to one row per (problem, language). Each row has the single interface for its language (python, cpp, go, java, rust, javascript, typescript, php, ruby), plus the shared canonical_tests (a Python check(candidate) oracle), problem_description, and metadata. Stored as data/<split>/<lang>-NNN.jsonl (row-boundary shards so every file stays under HF's ~10 MiB per-file ceiling); HF globs them into a single split.

Splits

  • train: 2274 problems x 9 languages (2641 in source; 367 lack complete interfaces).
  • test: 201 problems x 9 languages = 1809 rows (held-out eval).

Load

from datasets import load_dataset
train = load_dataset("neulab/leetcode", split="train")  # one Dataset, all rows
test  = load_dataset("neulab/leetcode", split="test")   # one Dataset, 1809 rows
python_rows = test.filter(lambda r: r["language"] == "python")