Datasets:
Rebuild from a fresh LeetCode crawl: cleaned tests, exact constraints, public_tests and hints
#2
by zhihechen - opened
This view is limited to 50 files because it contains too many changes. See the raw diff here.
- README.md +22 -12
- data/test/{cpp.jsonl → cpp-000.jsonl} +0 -0
- data/test/{go.jsonl → go-000.jsonl} +0 -0
- data/test/java-000.jsonl +0 -0
- data/test/java.jsonl +0 -0
- data/test/javascript-000.jsonl +0 -0
- data/test/javascript.jsonl +0 -0
- data/test/php-000.jsonl +0 -0
- data/test/php.jsonl +0 -0
- data/test/python-000.jsonl +0 -0
- data/test/python.jsonl +0 -0
- data/test/ruby-000.jsonl +0 -0
- data/test/ruby.jsonl +0 -0
- data/test/rust-000.jsonl +0 -0
- data/test/rust.jsonl +0 -0
- data/test/typescript-000.jsonl +0 -0
- data/test/typescript.jsonl +0 -0
- data/train/cpp-000.jsonl +0 -0
- data/train/cpp-001.jsonl +0 -0
- data/train/cpp-002.jsonl +0 -0
- data/train/cpp-003.jsonl +0 -0
- data/train/cpp-004.jsonl +0 -0
- data/train/go-000.jsonl +0 -0
- data/train/go-001.jsonl +0 -0
- data/train/go-002.jsonl +0 -0
- data/train/go-003.jsonl +0 -0
- data/train/go-004.jsonl +0 -0
- data/train/java-000.jsonl +0 -0
- data/train/java-001.jsonl +0 -0
- data/train/java-002.jsonl +0 -0
- data/train/java-003.jsonl +0 -0
- data/train/java-004.jsonl +0 -0
- data/train/javascript-000.jsonl +0 -0
- data/train/javascript-001.jsonl +0 -0
- data/train/javascript-002.jsonl +0 -0
- data/train/javascript-003.jsonl +0 -0
- data/train/javascript-004.jsonl +0 -0
- data/train/php-000.jsonl +0 -0
- data/train/php-001.jsonl +0 -0
- data/train/php-002.jsonl +0 -0
- data/train/php-003.jsonl +0 -0
- data/train/php-004.jsonl +0 -0
- data/train/python-000.jsonl +0 -0
- data/train/python-001.jsonl +0 -0
- data/train/python-002.jsonl +0 -0
- data/train/python-003.jsonl +0 -0
- data/train/python-004.jsonl +0 -0
- data/train/ruby-000.jsonl +0 -0
- data/train/ruby-001.jsonl +0 -0
- data/train/ruby-002.jsonl +0 -0
README.md
CHANGED
|
@@ -8,25 +8,35 @@ task_categories:
|
|
| 8 |
|
| 9 |
# LeetCode multilingual benchmark dataset
|
| 10 |
|
| 11 |
-
|
| 12 |
-
one row per (problem, language)
|
| 13 |
-
|
| 14 |
-
the shared `canonical_tests` (
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
## Splits
|
| 20 |
|
| 21 |
-
- `train`:
|
| 22 |
-
|
| 23 |
-
- `test`: 201 problems x 9 languages = 1809 rows (held-out eval).
|
| 24 |
|
| 25 |
## Load
|
| 26 |
|
| 27 |
```python
|
| 28 |
from datasets import load_dataset
|
| 29 |
-
train = load_dataset("neulab/leetcode", split="train")
|
| 30 |
-
test = load_dataset("neulab/leetcode", split="test")
|
| 31 |
python_rows = test.filter(lambda r: r["language"] == "python")
|
| 32 |
```
|
|
|
|
| 8 |
|
| 9 |
# LeetCode multilingual benchmark dataset
|
| 10 |
|
| 11 |
+
LeetCode problems for the msl-multilingual-self-learning benchmark, flattened to
|
| 12 |
+
one row per (problem, language) in 9 languages, stored as `data/<split>/<lang>-NNN.jsonl`.
|
| 13 |
+
Each row has the `interface` for its `language` (from LeetCode's code snippets),
|
| 14 |
+
the shared `canonical_tests` (Python asserts from newfacade/LeetCodeDataset),
|
| 15 |
+
the `problem_description` (from the LeetCode page) and `metadata`.
|
| 16 |
+
|
| 17 |
+
Tests that break the problem's Constraints, do not fit a declared type in some
|
| 18 |
+
language, or expect inf/nan were removed; problems that take trees or linked
|
| 19 |
+
lists, modify their input in place, or kept fewer than 10 tests were dropped.
|
| 20 |
+
The test split also drops problems with several valid answers or whose text
|
| 21 |
+
refers to a figure. Where answers may come in any order or are decimals,
|
| 22 |
+
the asserts call `answers_match` (defined at the top of the test source), and
|
| 23 |
+
`canonical_tests.comparison` says which rule applies ("unordered", "float" or "exact").
|
| 24 |
+
`public_tests` holds the inputs of LeetCode's Testcase panel (one string per
|
| 25 |
+
case, one JSON value per line in parameter order; LeetCode publishes no
|
| 26 |
+
outputs), and `hints` the page's hints as plain text.
|
| 27 |
+
`reports/dropped.md` lists every dropped problem and test count, and
|
| 28 |
+
`reports/<split>.json` has the details.
|
| 29 |
|
| 30 |
## Splits
|
| 31 |
|
| 32 |
+
- `train`: 2103 problems x 9 languages = 18927 rows (2641 in the source dataset)
|
| 33 |
+
- `test`: 191 problems x 9 languages = 1719 rows (228 in the source dataset)
|
|
|
|
| 34 |
|
| 35 |
## Load
|
| 36 |
|
| 37 |
```python
|
| 38 |
from datasets import load_dataset
|
| 39 |
+
train = load_dataset("neulab/leetcode", split="train")
|
| 40 |
+
test = load_dataset("neulab/leetcode", split="test")
|
| 41 |
python_rows = test.filter(lambda r: r["language"] == "python")
|
| 42 |
```
|
data/test/{cpp.jsonl → cpp-000.jsonl}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/{go.jsonl → go-000.jsonl}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/java-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/java.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/javascript-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/javascript.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/php-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/php.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/python-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/python.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/ruby-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/ruby.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/rust-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/rust.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/typescript-000.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/test/typescript.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/cpp-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/cpp-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/cpp-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/cpp-003.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/cpp-004.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/go-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/go-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/go-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/go-003.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/go-004.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/java-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/java-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/java-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/java-003.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/java-004.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/javascript-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/javascript-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/javascript-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/javascript-003.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/javascript-004.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/php-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/php-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/php-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/php-003.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/php-004.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/python-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/python-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/python-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/python-003.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/python-004.jsonl
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/ruby-000.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/ruby-001.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/train/ruby-002.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|