Rebuild from a fresh LeetCode crawl: cleaned tests, exact constraints, public_tests and hints

#2
This view is limited to 50 files because it contains too many changes. See the raw diff here.
Files changed (50) hide show
  1. README.md +22 -12
  2. data/test/{cpp.jsonl → cpp-000.jsonl} +0 -0
  3. data/test/{go.jsonl → go-000.jsonl} +0 -0
  4. data/test/java-000.jsonl +0 -0
  5. data/test/java.jsonl +0 -0
  6. data/test/javascript-000.jsonl +0 -0
  7. data/test/javascript.jsonl +0 -0
  8. data/test/php-000.jsonl +0 -0
  9. data/test/php.jsonl +0 -0
  10. data/test/python-000.jsonl +0 -0
  11. data/test/python.jsonl +0 -0
  12. data/test/ruby-000.jsonl +0 -0
  13. data/test/ruby.jsonl +0 -0
  14. data/test/rust-000.jsonl +0 -0
  15. data/test/rust.jsonl +0 -0
  16. data/test/typescript-000.jsonl +0 -0
  17. data/test/typescript.jsonl +0 -0
  18. data/train/cpp-000.jsonl +0 -0
  19. data/train/cpp-001.jsonl +0 -0
  20. data/train/cpp-002.jsonl +0 -0
  21. data/train/cpp-003.jsonl +0 -0
  22. data/train/cpp-004.jsonl +0 -0
  23. data/train/go-000.jsonl +0 -0
  24. data/train/go-001.jsonl +0 -0
  25. data/train/go-002.jsonl +0 -0
  26. data/train/go-003.jsonl +0 -0
  27. data/train/go-004.jsonl +0 -0
  28. data/train/java-000.jsonl +0 -0
  29. data/train/java-001.jsonl +0 -0
  30. data/train/java-002.jsonl +0 -0
  31. data/train/java-003.jsonl +0 -0
  32. data/train/java-004.jsonl +0 -0
  33. data/train/javascript-000.jsonl +0 -0
  34. data/train/javascript-001.jsonl +0 -0
  35. data/train/javascript-002.jsonl +0 -0
  36. data/train/javascript-003.jsonl +0 -0
  37. data/train/javascript-004.jsonl +0 -0
  38. data/train/php-000.jsonl +0 -0
  39. data/train/php-001.jsonl +0 -0
  40. data/train/php-002.jsonl +0 -0
  41. data/train/php-003.jsonl +0 -0
  42. data/train/php-004.jsonl +0 -0
  43. data/train/python-000.jsonl +0 -0
  44. data/train/python-001.jsonl +0 -0
  45. data/train/python-002.jsonl +0 -0
  46. data/train/python-003.jsonl +0 -0
  47. data/train/python-004.jsonl +0 -0
  48. data/train/ruby-000.jsonl +0 -0
  49. data/train/ruby-001.jsonl +0 -0
  50. data/train/ruby-002.jsonl +0 -0
README.md CHANGED
@@ -8,25 +8,35 @@ task_categories:
8
 
9
  # LeetCode multilingual benchmark dataset
10
 
11
- Post-interface rows for the msl-multilingual-self-learning benchmark, flattened to
12
- one row per (problem, language). Each row has the single `interface` for its
13
- `language` (python, cpp, go, java, rust, javascript, typescript, php, ruby), plus
14
- the shared `canonical_tests` (a Python check(candidate) oracle), `problem_description`,
15
- and `metadata`. Stored as `data/<split>/<lang>-NNN.jsonl` (row-boundary shards so
16
- every file stays under HF's ~10 MiB per-file ceiling); HF globs them into a single
17
- split.
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  ## Splits
20
 
21
- - `train`: 2274 problems x 9 languages (2641 in source; 367 lack complete
22
- interfaces).
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") # one Dataset, all rows
30
- test = load_dataset("neulab/leetcode", split="test") # one Dataset, 1809 rows
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