license: openmdw-1.1
language:
- en
pretty_name: S
Code Syntax Dataset (S)
A large-scale, high‑quality dataset for teaching large language models to identify and correct common syntax errors across 30+ programming languages.
Contains 500,000+ unique examples (≈110 MB) with English explanations – no artificial padding.
📊 Dataset Format
The dataset is provided as a single CSV file with the following columns:
| Column | Type | Description |
|---|---|---|
wrong_code |
string | Code snippet containing a syntax error |
correct_code |
string | The corrected version of the same snippet |
explanation |
string | Concise, plain‑English explanation of the mistake and fix |
language |
string | Programming language (e.g., Python, JavaScript, Rust) |
🧠 Languages Covered
The dataset includes examples from 30+ languages and technologies:
| Category | Languages |
|---|---|
| General‑purpose | Python, JavaScript, TypeScript, Java, C#, C++, Rust, Go, Ruby, PHP, Perl, Swift, Kotlin, R, MATLAB |
| Web | HTML, CSS |
| Database | SQL (MySQL/PostgreSQL‑style) |
| Shell / Scripting | Bash, PowerShell |
| Markup / Config | YAML, JSON, XML, Markdown |
| Backend / Node.js | Express, fs, JWT, bcrypt, Mongoose |
💡 Example Entries
Here are a few sample rows to illustrate the dataset content:
| 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 |
Each example is unique – variable names, numbers, and string values are randomised, ensuring a wide variety of patterns for robust model training.
🎯 Use Cases
- Fine‑tuning LLMs – train models to correct erroneous code or to generate correct code from buggy input.
- Building code‑review assistants – create tools that automatically detect and suggest fixes for common syntax mistakes.
- Educational materials – use the dataset as a large, searchable bank of common programming pitfalls.
- Benchmarking – evaluate how well models understand language‑specific syntax rules.
📈 Dataset Statistics
| Metric | Value |
|---|---|
| Total rows | ~500,000 – 550,000 |
| File size | ≈110 MB (uncompressed CSV) |
| Languages | 30+ |
| Unique templates | 130+ error patterns, each parameterised with random values |
📄 License
This dataset is released under the Open Metadata License (OpenMDW v1.1) – you are free to use, modify, and distribute it for any purpose, subject to the terms of that license.
🙋 Contributions & Feedback
If you have suggestions for additional languages, error patterns, or improvements, feel free to reach out or open an issue. We welcome contributions to make this dataset even more comprehensive.
Happy training! 🚀