CoolFace
Datasetpublic

Gugu8/Code-Syntax-Expanded

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… See the full description on the dataset page: https://huggingface.co/datasets/Gugu8/Code-Syntax-Expanded.

sourceHugging Faceotherupdated 2mo agoView on Hugging Face
0likes24downloads
Dataset Card

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

PropertyValue
Total rows5,000,000+
File size~1.1 GB (uncompressed CSV)
Languages33
Unique templates160+ error patterns
FormatCSV (4 columns)
LicenseODA-TL v1.0

πŸ“ Dataset Structure

Each row contains:

ColumnDescription
wrong_codeCode snippet containing a syntax error
correct_codeCorrected version of the snippet
explanationConcise English explanation of the error and fix
languageProgramming 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

LanguageExamples (approximate)Key Error Types
Python350,000+Missing colons, indentation, == vs =, imports
JavaScript300,000+Missing parentheses, === vs ==, const reassignment
Rust200,000+Borrow checker, moves, mutable references
Java250,000+Semicolons, type mismatches, array bounds
SQL200,000+Missing commas, WHERE typos, quoting
HTML/CSS250,000+Nesting, self-closing tags, attribute quoting
Others3,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_codecorrect_codeexplanationlanguage
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