CoolFace
Datasetpublic

Gugu8/Code-Syntax

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

sourceHugging Faceopenmdw-1.1updated 2mo agoView on Hugging Face
0likes18downloads
Dataset Card

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:

ColumnTypeDescription
wrong_codestringCode snippet containing a syntax error
correct_codestringThe corrected version of the same snippet
explanationstringConcise, plain‑English explanation of the mistake and fix
languagestringProgramming language (e.g., Python, JavaScript, Rust)

🧠 Languages Covered

The dataset includes examples from 30+ languages and technologies:

CategoryLanguages
General‑purposePython, JavaScript, TypeScript, Java, C#, C++, Rust, Go, Ruby, PHP, Perl, Swift, Kotlin, R, MATLAB
WebHTML, CSS
DatabaseSQL (MySQL/PostgreSQL‑style)
Shell / ScriptingBash, PowerShell
Markup / ConfigYAML, JSON, XML, Markdown
Backend / Node.jsExpress, fs, JWT, bcrypt, Mongoose

💡 Example Entries

Here are a few sample rows to illustrate the dataset content:

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

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

MetricValue
Total rows~500,000 – 550,000
File size≈110 MB (uncompressed CSV)
Languages30+
Unique templates130+ 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! 🚀