AmareshHebbar commited on
Commit
fae5c7d
·
verified ·
1 Parent(s): ce5241b

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +57 -8
README.md CHANGED
@@ -4,23 +4,72 @@ task_categories:
4
  - text-generation
5
  language:
6
  - en
 
 
 
7
  tags:
8
  - code
9
  - python
10
  - leetcode
11
  - algorithms
 
 
 
 
12
  ---
13
 
14
  # LeetCode Code-Gen Dataset — Python
15
 
16
- Problem statement + examples + required algorithm/technique -> Python solution.
17
- 2522 rows. Sourced from doocs/leetcode.
18
 
19
- Every row execution-verified against the problem's own examples.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  ## Fields
22
- - `slug`: LeetCode problem slug
23
- - `solution_id`: unique id, problem + approach index + language
24
- - `primary_algorithm`: normalized algorithm/technique label
25
- - `verified`: true/false for Python (execution-checked), null for other languages
26
- - `messages`: chat-format (system/user/assistant), ready for SFT
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - text-generation
5
  language:
6
  - en
7
+ pretty_name: LeetCode Code-Gen (Python)
8
+ size_categories:
9
+ - 1K<n<10K
10
  tags:
11
  - code
12
  - python
13
  - leetcode
14
  - algorithms
15
+ - code-generation
16
+ - competitive-programming
17
+ - instruction-tuning
18
+ - sft
19
  ---
20
 
21
  # LeetCode Code-Gen Dataset — Python
22
 
23
+ 2522 rows. Given a problem statement, its input/output examples, and a
24
+ required algorithm/technique, generate a correct Python solution.
25
 
26
+ Part of a 4-language collection built from the same source: see the sibling
27
+ [Python](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-python),
28
+ [Java](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-java),
29
+ [C++](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-cpp), and
30
+ [JavaScript](https://huggingface.co/datasets/AmareshHebbar/leetcode-codegen-javascript)
31
+ datasets.
32
+
33
+ ## Verification
34
+
35
+ Every row was extracted, then executed in a sandboxed subprocess against the problem's own stated examples. Only rows that passed all examples are included -- this is not just scraped code, it's checked code.
36
+
37
+ ## Source
38
+
39
+ Extracted from [doocs/leetcode](https://github.com/doocs/leetcode), which
40
+ documents multiple named solution approaches per problem (e.g. "Dynamic
41
+ Programming", "Two Pointers", "Divide and Conquer") -- this is what makes
42
+ per-row algorithm labeling possible, since the same problem can appear
43
+ multiple times with a different technique and different code each time.
44
 
45
  ## Fields
46
+
47
+ | field | description |
48
+ |---|---|
49
+ | `slug` | LeetCode problem slug |
50
+ | `solution_id` | unique id: problem + approach index + language |
51
+ | `primary_algorithm` | normalized algorithm/technique label |
52
+ | `verified` | `true`/`false` for Python (execution-checked), `null` for other languages |
53
+ | `messages` | chat-format (system/user/assistant), ready for SFT |
54
+
55
+ ## Example row
56
+
57
+ ```json
58
+ {
59
+ "slug": "house-robber",
60
+ "primary_algorithm": "Dynamic Programming",
61
+ "messages": [
62
+ {"role": "system", "content": "You are a competitive programming assistant..."},
63
+ {"role": "user", "content": "### Problem\n...\n### Algorithm\nDynamic Programming"},
64
+ {"role": "assistant", "content": "```python\n...\n```"}
65
+ ]
66
+ }
67
+ ```
68
+
69
+ ## Known gaps
70
+
71
+ - SQL/database problems excluded (wrong problem type for a code-execution harness)
72
+ - Design/class problems (LRU Cache, iterators) excluded -- they need a
73
+ sequence of method calls to test, not a single input -> output check
74
+ - Some `Brute Force` labels are a fallback where the source didn't name a
75
+ specific technique for that approach