Datasets:
language:
- en
license: mit
task_categories:
- text-classification
tags:
- code
- source-code
- programming-languages
- language-identification
- language-classification
- code-classification
- machine-learning
- classification
- benchmark
- code-intelligence
- software-engineering
pretty_name: Programming Language Classification Dataset
size_categories:
- 1M<n<10M
Programming Language Classification Dataset
A large-scale, balanced dataset for programming language identification from source code snippets.
Overview
This dataset contains 1.664 million cleaned and labeled source code samples across 16 programming languages, specifically designed for programming language classification and identification tasks.
Unlike many code datasets that are primarily built for code generation or retrieval, this dataset was curated specifically for language classification. Significant effort was invested in deduplication, quality filtering, class balancing, and evaluation split construction to create a reliable benchmark for training and evaluating language identification models.
Key Features
- 1.664 million labeled samples
- 16 programming languages
- Class-balanced dataset
- Multi-stage deduplication pipeline
- Quality-filtered samples
- Fixed train/validation/test splits
- Suitable for both traditional ML and neural approaches
Supported Languages
| Language |
|---|
| Assembly |
| C |
| C++ |
| C# |
| CSS |
| Dart |
| Go |
| HTML |
| Java |
| JavaScript |
| Kotlin |
| Lua |
| Markdown |
| Python |
| Rust |
| TypeScript |
Dataset Statistics
| Split | Samples per Language | Total Samples |
|---|---|---|
| Train | 100,000 | 1,600,000 |
| Validation | 2,000 | 32,000 |
| Test | 2,000 | 32,000 |
| Total | 104,000 | 1,664,000 |
The dataset is fully balanced across all languages to reduce class imbalance and evaluation bias.
Data Format
Samples are stored in JSONL format.
{
"content": "def hello_world():\n print('Hello World')",
"label": "Python"
}
Source Dataset
This dataset was derived from:
https://huggingface.co/datasets/lumees/github-code-2025-language-split
The original dataset was language-separated and used as the foundation for further processing, cleaning, filtering, balancing, and dataset construction.
Dataset Construction Pipeline
The dataset was created through a multi-stage processing pipeline.
1. Language-Based Collection
Source code was collected from the source dataset and organized by programming language.
2. Code Chunk Generation
Large source files were segmented into smaller code snippets suitable for language classification tasks.
This increases sample diversity while making training more efficient.
3. Multi-Stage Deduplication
Several rounds of deduplication were applied to reduce repeated and near-duplicate code fragments.
The objective was to improve diversity and reduce memorization of highly repetitive samples.
4. Quality Filtering
A custom filtering pipeline was applied to remove low-quality samples.
Filtering stages included:
- Low-information sample detection
- Repetitive content removal
- Character distribution analysis
- Symbol-density analysis
- Structural code heuristics
- Corrupted fragment removal
Conservative filtering thresholds were intentionally used to preserve valid code across languages with very different syntactic structures such as Assembly, CSS, HTML, Markdown, and Python.
5. Balanced Sampling
Many languages originally contained substantially different numbers of samples.
To prevent majority-language bias, a balanced subset was created for every language.
Each language contributes exactly:
- 100,000 training samples
- 2,000 validation samples
- 2,000 test samples
6. Split Construction
Validation and test sets were sampled independently for each language to ensure balanced and reliable evaluation.
Design Goals
The dataset was built with the following objectives:
- Balanced language representation
- Reduced duplication
- High sample diversity
- Reliable evaluation splits
- Efficient classifier training
- Support for both classical ML and neural approaches