Commit ·
e8dc9be
1
Parent(s): e03fc04
Update README.md
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717 unmodified lines7980818283848586878889909192939495969798992 unmodified lines1021031041051061071083 unmodified lines1121131141151161171186 unmodified lines125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164---license: mitlanguage:- entags:- code---# MultiLang Code Parser Dataset (MLCPD)## Dataset DescriptionThe MultiLang Code Parser Dataset (MLCPD) is a comprehensive multi-language code dataset designed to benchmark language-agnostic AI code parsers. It currently offers a filtered version of the StarCoder dataset, parsed with language-specific parsers, with future plans to unify outputs into a standard JSON format for complete AST representation.### Key Features- **Cleaned and Filtered Code**: Samples have been processed to remove outliers in terms of line length and code size- **Quality Metrics**: Each sample includes metadata about average line length and line count of code along with AST node count and error count- **Multi-language Support**: 10 programming languages represented in separate subsets- **Consistent Format**: All samples follow the same Parquet structure for easy processing### Dataset SizeThe complete dataset is approximately 35GB in size. Individual language files vary in size, with the largest being C++ (5.85GB) and the smallest being Ruby (1.71GB).### Dataset Statistics| Language | Sample Count | Avg. Line Length | Avg. Line Count ||------------|--------------|------------------|-----------------|| C | 700,821 | 28.08 | 61.76 || C++ | 707,641 | 28.16 | 87.88 || C# | 705,203 | 29.53 | 44.26 || Go | 700,331 | 25.18 | 68.22 || Java | 711,922 | 30.85 | 54.40 || JavaScript | 687,775 | 27.69 | 44.15 || Python | 706,126 | 32.67 | 54.70 || Ruby | 703,473 | 27.35 | 27.41 || Scala | 702,833 | 35.30 | 44.38 || TypeScript | 695,597 | 29.18 | 36.89 |## Dataset StructureThe dataset is organized with separate Parquet files for each programming language:- `c_parsed_1.parquet` ... `c_parsed_4.parquet` - C language samples- `cpp_parsed_1.parquet` ... `cpp_parsed_4.parquet` - C++ language samples- `c_sharp_parsed_1.parquet` ... `c_sharp_parsed_4.parquet` - C# language samples- `go_parsed_1.parquet` ... `go_parsed_4.parquet` - Go language samples- `java_parsed_1.parquet` ... `java_parsed_4.parquet` - Java language samples- `javascript_parsed_1.parquet` ... `javascript_parsed_4.parquet` - JavaScript language samples- `python_parsed_1.parquet` ... `python_parsed_4.parquet` - Python language samples- `ruby_parsed_1.parquet` ... `ruby_parsed_4.parquet` - Ruby language samples- `scala_parsed_1.parquet` ... `scala_parsed_4.parquet` - Scala language samples- `typescript_parsed_1.parquet` ... `typescript_parsed_4.parquet` - TypeScript language samplesWithin each file, data is stored with the following schema:```- language: string (the programming language of the code sample)- code: string (the complete code content)- avg_line_length: float (average character count per line)- line_count: integer (total number of lines in the code)- lang_specific_parse: string (tree-sitter parsed output of the code sample)- ast_node_count: integer (total number of nodes in the AST)- num_errors: integer (total number of errors in the code)```Each sample is stored as a row in the Parquet file with these four columns.## How to Access the Dataset### Using the Hugging Face `datasets` Library7 unmodified lines#### Import Library```pythonfrom datasets import load_dataset```#### Load the Entire Dataset```pythondataset = load_dataset("jugalgajjar/MultiLang-Code-Parser-Dataset")```#### Load a Specific Language```pythondataset = load_dataset("jugalgajjar/MultiLang-Code-Parser-Dataset",data_files="python_parsed_1.parquet"2 unmodified lines#### Stream Data```pythondataset = load_dataset("jugalgajjar/MultiLang-Code-Parser-Dataset",data_files="python_parsed_1.parquet",3 unmodified lines#### Access Data Content (After Downloading)```pythontry:for example in dataset["train"].take(5):print(example)6 unmodified linesYou can also manually download specific language files from the Hugging Face repository page:1. Visit `https://huggingface.co/datasets/jugalgajjar/MultiLang-Code-Parser-Dataset`2. Navigate to the "Files" tab3. Click on the language file you want to download (e.g., `python_parsed_1.parquet`)4. Use the download button to save the file locally## Dataset CreationThis dataset was created through the following process:1. Original code samples were collected from the StarCoder dataset ([URL](https://huggingface.co/datasets/bigcode/starcoderdata))2. Statistical analysis was performed to identify quality metrics3. Outliers were removed using IQR (Interquartile Range) method4. Samples were filtered to remove excessively long or short code examples5. Data was normalized and standardized across languages6. Metadata (average line length and line count) was calculated for each sample7. Data was serialized in the efficient Parquet format for optimal storage and access speed8. Code samples from each language were parsed using language-specific tree-sitter parsers9. Metadata (AST node count and number of errors in the code) were recorded for each sample10. Final data was split into four files and stored in the Parquet format## CitationIf you use this dataset in your research or project, please cite it as follows:```bibtex@misc{mlcpd2025,author = {Jugal Gajjar, Kamalasankari Subramaniakuppusamy, Kaustik Ranaware},title = {Filtered CodeStar Dataset Mini},year = {2025},publisher = {HuggingFace},howpublished = {\url{https://huggingface.co/datasets/jugalgajjar/MultiLang-Code-Parser-Dataset}}}```## LicenseThis dataset is released under the MIT License. See the LICENSE file for more details.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990917 unmodified lines991001011021031041051061071081091101111121131141151161171181192 unmodified lines1221231241251261271283 unmodified lines1321331341351361371386 unmodified lines145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180# MultiLang Code Parser Dataset (MLCPD)[](https://opensource.org/licenses/MIT)[](https://www.python.org/downloads/)[](https://huggingface.co/datasets/jugalgajjar/MultiLang-Code-Parser-Dataset)**MultiLang-Code-Parser-Dataset (MLCPD)** provides a large-scale, unified dataset of parsed source code across 10 major programming languages, represented under a universal schema that captures syntax, semantics, and structure in a consistent format.Each entry corresponds to one parsed source file and includes:- Language metadata- Code-level statistics (lines, errors, AST nodes)- Universal Schema JSON (normalized structural representation)MLCPD enables robust cross-language analysis, code understanding, and representation learning by providing a consistent, language-agnostic data structure suitable for both traditional ML and modern LLM-based workflows.---## 📂 Dataset Structure```MultiLang-Code-Parser-Dataset/├── c_parsed_1.parquet├── c_parsed_2.parquet├── c_parsed_3.parquet├── c_parsed_4.parquet├── c_sharp_parsed_1.parquet├── ...└── typescript_parsed_4.parquet```Each file corresponds to one partition of a language (~175k rows each).Each record contains:| Field | Type | Description ||--------|------|-------------|| `language` | `str` | Programming language name || `code` | `str` | Raw source code || `avg_line_length` | `float` | Average line length || `line_count` | `int` | Number of lines || `lang_specific_parse` | `str` | TreeSitter parse output || `ast_node_count` | `int` | Number of AST nodes || `num_errors` | `int` | Parse errors || `universal_schema` | `str` | JSON-formatted unified schema |---## 📊 Key Statistics| Metric | Value ||--------|--------|| Total Languages | 10 || Total Files | 40 || Total Records | 7,021,722 || Successful Conversions | 7,021,718 (99.9999%) || Failed Conversions | 4 (3 in C, 1 in C++) || Disk Size | ~105 GB (Parquet format) || Memory Size | ~580 GB (Parquet format) |The dataset is clean, lossless, and statistically balanced across languages.It offers both per-language and combined cross-language representations.---## 🚀 Use CasesMLCPD can be directly used for:- Cross-language code representation learning- Program understanding and code similarity tasks- Syntax-aware pretraining for LLMs- Code summarization, clone detection, and bug prediction- Graph-based learning on universal ASTs- Benchmark creation for cross-language code reasoning---## 🔍 Features- **Universal Schema:** A unified structural representation harmonizing AST node types across languages.- **Compact Format:** Stored in Apache Parquet, allowing fast access and efficient querying.- **Cross-Language Compatibility:** Enables comparative code structure analysis across multiple programming ecosystems.- **Error-Free Parsing:** 99.9999% successful schema conversions across ~7M code files.- **Statistical Richness:** Includes per-language metrics such as mean line count, AST size, and error ratios.- **Ready for ML Pipelines:** Compatible with PyTorch, TensorFlow, Hugging Face Transformers, and graph-based models.---## 📥 How to Access the Dataset### Using the Hugging Face `datasets` Library7 unmodified lines#### Import Library```bashfrom datasets import load_dataset```#### Load the Entire Dataset```bashdataset = load_dataset("jugalgajjar/MultiLang-Code-Parser-Dataset")```#### Load a Specific Language File```bashdataset = load_dataset("jugalgajjar/MultiLang-Code-Parser-Dataset",data_files="python_parsed_1.parquet"2 unmodified lines#### Stream Data```bashdataset = load_dataset("jugalgajjar/MultiLang-Code-Parser-Dataset",data_files="python_parsed_1.parquet",3 unmodified lines#### Access Data Content (After Downloading)```bashtry:for example in dataset["train"].take(5):print(example)6 unmodified linesYou can also manually download specific language files from the Hugging Face repository page:1. Visit https://huggingface.co/datasets/jugalgajjar/MultiLang-Code-Parser-Dataset2. Navigate to the Files tab3. Click on the language file you want (e.g., `python_parsed_1.parquet`)4. Use the Download button to save locally---## 📜 LicenseThis dataset is released under the MIT License.<br>You are free to use, modify, and redistribute it for research and educational purposes, with proper attribution.---## 🙏 Acknowledgements- [StarCoder Dataset](https://huggingface.co/datasets/bigcode/starcoderdata) for source code samples- [TreeSitter](https://tree-sitter.github.io/tree-sitter/) for parsing- [Hugging Face](https://huggingface.co/) for dataset hosting---## 📧 ContactFor questions, collaborations, or feedback:- **Primary Author**: Jugal Gajjar- **Email**: [812jugalgajjar@gmail.com](mailto:812jugalgajjar@gmail.com)- **LinkedIn**: [linkedin.com/in/jugal-gajjar/](https://www.linkedin.com/in/jugal-gajjar/)---⭐ If you find this dataset useful, consider liking the dataset and the [GitHub repository](https://github.com/JugalGajjar/MultiLang-Code-Parser-Dataset) and sharing your work that uses it.
README.md+110-94