Datasets:

Modalities:
Text
Formats:
csv
Languages:
English
License:
File size: 3,186 Bytes
c4ba185
 
 
 
d00e20d
 
 
 
 
 
 
c4ba185
0ab6721
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
license: other
license_name: open-data-attribution-training-disclosure-license-odatl-1.0
license_link: LICENSE
language:
- en
tags:
- synthetic
- code
size_categories:
- 100M<n<1B
---

# Code-Syntax-Expanded

A **massive, high-quality synthetic dataset** for training LLMs to identify and correct syntax errors across **33 programming languages**. Contains **5+ million unique examples** (~1.1 GB) with English explanations – no artificial padding, no duplicate rows.

---

## 📊 Dataset Overview

| Property | Value |
|----------|-------|
| **Total rows** | 5,000,000+ |
| **File size** | ~1.1 GB (uncompressed CSV) |
| **Languages** | 33 |
| **Unique templates** | 160+ error patterns |
| **Format** | CSV (4 columns) |
| **License** | ODA-TL v1.0 |

---

## 📁 Dataset Structure

Each row contains:

| Column | Description |
|--------|-------------|
| `wrong_code` | Code snippet containing a syntax error |
| `correct_code` | Corrected version of the snippet |
| `explanation` | Concise English explanation of the error and fix |
| `language` | Programming language (e.g., `Python`, `JavaScript`, `Rust`) |

---

## 🧠 Languages Covered

### General Purpose
Python, JavaScript, TypeScript, Java, C#, C++, Rust, Go, Ruby, PHP, Perl, Swift, Kotlin, R, MATLAB, Scala, Lua, Dart

### Web Technologies
HTML, CSS

### Database
SQL (MySQL/PostgreSQL-style)

### Shell & Scripting
Bash, PowerShell

### Markup & Configuration
YAML, JSON, XML, Markdown

### Backend & Frameworks
Node.js (Express, fs, JWT, bcrypt, Mongoose)

---

## 📈 Dataset Statistics

| Language | Examples (approximate) | Key Error Types |
|----------|------------------------|-----------------|
| Python | 350,000+ | Missing colons, indentation, `==` vs `=`, imports |
| JavaScript | 300,000+ | Missing parentheses, `===` vs `==`, const reassignment |
| Rust | 200,000+ | Borrow checker, moves, mutable references |
| Java | 250,000+ | Semicolons, type mismatches, array bounds |
| SQL | 200,000+ | Missing commas, WHERE typos, quoting |
| HTML/CSS | 250,000+ | Nesting, self-closing tags, attribute quoting |
| Others | 3,200,000+ | Language-specific syntax rules |

---

## 🎯 Use Cases

- **Fine-tuning LLMs** for code correction and syntax repair
- **Building code review assistants** that detect common mistakes
- **Teaching programming** with a massive bank of error/fix examples
- **Benchmarking** model understanding of language-specific syntax
- **Creating educational tools** for learning programming languages

---

## 💡 Example Entries

| wrong_code | correct_code | explanation | language |
|------------|--------------|-------------|----------|
| `if x > 5\n    print('hello')` | `if x > 5:\n    print('hello')` | Colon missing after if. | Python |
| `console.log('world'` | `console.log('world')` | Close parenthesis. | JavaScript |
| `let mut x=5; let r1=&mut x; let r2=&mut x;` | `let mut x=5; { let r1=&mut x; } let r2=&mut x;` | Only one mutable borrow allowed. | Rust |
| `SELECT name age FROM users;` | `SELECT name, age FROM users;` | Missing comma between columns. | SQL |
| `<p>Hello <b>world!</p></b>` | `<p>Hello <b>world!</b></p>` | Improper nesting of tags. | HTML |

---