Commit
·
6966282
1
Parent(s):
e461dd4
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,138 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Filtered StarCoder Dataset Mini
|
| 2 |
+
|
| 3 |
+
## Dataset Description
|
| 4 |
+
|
| 5 |
+
This dataset contains filtered and processed code samples from 12 popular programming languages: C, C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Rust, Scala, and TypeScript. The dataset was created by filtering source code based on quality metrics, removing outliers, and standardizing the format for machine learning and code analysis applications.
|
| 6 |
+
|
| 7 |
+
### Key Features
|
| 8 |
+
|
| 9 |
+
- **Cleaned and Filtered Code**: Samples have been processed to remove outliers in terms of line length and code size
|
| 10 |
+
- **Quality Metrics**: Each sample includes metadata about average line length and line count
|
| 11 |
+
- **Multi-language Support**: 12 programming languages represented in separate subsets
|
| 12 |
+
- **Consistent Format**: All samples follow the same JSON structure for easy processing
|
| 13 |
+
|
| 14 |
+
### Dataset Statistics
|
| 15 |
+
|
| 16 |
+
| Language | Sample Count | Avg. Line Length | Avg. Line Count |
|
| 17 |
+
|------------|--------------|------------------|-----------------|
|
| 18 |
+
| C | 1,751,894 | 22.55 | 74.48 |
|
| 19 |
+
| C++ | 1,769,514 | 23.50 | 103.59 |
|
| 20 |
+
| C# | 1,762,960 | 25.76 | 51.50 |
|
| 21 |
+
| Go | 1,750,873 | 20.68 | 81.76 |
|
| 22 |
+
| Java | 1,778,689 | 25.48 | 64.56 |
|
| 23 |
+
| JavaScript | 1,719,140 | 23.31 | 51.29 |
|
| 24 |
+
| Kotlin | 1,589,735 | 27.39 | 42.31 |
|
| 25 |
+
| Python | 1,764,481 | 26.52 | 66.15 |
|
| 26 |
+
| Ruby | 1,758,558 | 22.31 | 33.95 |
|
| 27 |
+
| Rust | 1,341,806 | 27.36 | 190.37 |
|
| 28 |
+
| Scala | 1,322,906 | 31.48 | 94.89 |
|
| 29 |
+
| TypeScript | 1,738,950 | 24.15 | 43.46 |
|
| 30 |
+
|
| 31 |
+
## Dataset Structure
|
| 32 |
+
|
| 33 |
+
The dataset is organized with separate JSON files for each programming language:
|
| 34 |
+
- `c.json` - C language samples
|
| 35 |
+
- `cpp.json` - C++ language samples
|
| 36 |
+
- `c-sharp.json` - C# language samples
|
| 37 |
+
- `go.json` - Go language samples
|
| 38 |
+
- `java.json` - Java language samples
|
| 39 |
+
- `javascript.json` - JavaScript language samples
|
| 40 |
+
- `kotlin.json` - Kotlin language samples
|
| 41 |
+
- `python.json` - Python language samples
|
| 42 |
+
- `ruby.json` - Ruby language samples
|
| 43 |
+
- `rust.json` - Rust language samples
|
| 44 |
+
- `scala.json` - Scala language samples
|
| 45 |
+
- `typescript.json` - TypeScript language samples
|
| 46 |
+
|
| 47 |
+
Within each file, data is stored in the following format:
|
| 48 |
+
|
| 49 |
+
```json
|
| 50 |
+
{
|
| 51 |
+
"lang_0": {
|
| 52 |
+
"code": "ENTIRE CODE",
|
| 53 |
+
"avg_line_length": 35.7,
|
| 54 |
+
"line_count": 120
|
| 55 |
+
},
|
| 56 |
+
"lang_1": {
|
| 57 |
+
"code": "ANOTHER CODE EXAMPLE",
|
| 58 |
+
"avg_line_length": 42.3,
|
| 59 |
+
"line_count": 85
|
| 60 |
+
},
|
| 61 |
+
...
|
| 62 |
+
"lang_N": {
|
| 63 |
+
"code": "ENTIRE CODE",
|
| 64 |
+
"avg_line_length": 28.9,
|
| 65 |
+
"line_count": 67
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
Each sample is assigned a unique integer ID (0 to N) prefixed with the language identifier.
|
| 71 |
+
|
| 72 |
+
## How to Access the Dataset
|
| 73 |
+
|
| 74 |
+
### Using the Hugging Face `datasets` Library
|
| 75 |
+
|
| 76 |
+
This dataset is hosted on the Hugging Face Hub and can be easily accessed using the `datasets` library.
|
| 77 |
+
|
| 78 |
+
#### Install the Required Library
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
pip install datasets
|
| 82 |
+
```
|
| 83 |
+
|
| 84 |
+
#### Load the Entire Dataset
|
| 85 |
+
|
| 86 |
+
```python
|
| 87 |
+
TODO
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
#### Load a Specific Language
|
| 91 |
+
|
| 92 |
+
```python
|
| 93 |
+
TODO
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
### Manual Download
|
| 97 |
+
|
| 98 |
+
You can also manually download specific language files from the Hugging Face repository page:
|
| 99 |
+
|
| 100 |
+
1. Visit `https://huggingface.co/datasets/jugalgajjar/Filtered-StarCoder-Dataset-Mini`
|
| 101 |
+
2. Navigate to the "Files" tab
|
| 102 |
+
3. Click on the language file you want to download (e.g., `python.json`)
|
| 103 |
+
4. Use the download button to save the file locally
|
| 104 |
+
|
| 105 |
+
## Dataset Creation
|
| 106 |
+
|
| 107 |
+
This dataset was created through the following process:
|
| 108 |
+
|
| 109 |
+
1. Original code samples were collected from the StarCoder dataset ([URL](https://huggingface.co/datasets/bigcode/starcoderdata))
|
| 110 |
+
2. Statistical analysis was performed to identify quality metrics
|
| 111 |
+
3. Outliers were removed using IQR (Interquartile Range) method
|
| 112 |
+
4. Samples were filtered to remove excessively long or short code examples
|
| 113 |
+
5. Data was normalized and standardized across languages
|
| 114 |
+
6. Metadata (average line length and line count) was calculated for each sample
|
| 115 |
+
|
| 116 |
+
The processing pipeline included steps to:
|
| 117 |
+
- Remove code samples with abnormal line lengths (potential formatting issues)
|
| 118 |
+
- Filter out extremely long files (exceeding the 90th percentile)
|
| 119 |
+
- Ensure consistent formatting and structure
|
| 120 |
+
- Generate useful metadata for each example
|
| 121 |
+
|
| 122 |
+
## Citation
|
| 123 |
+
|
| 124 |
+
If you use this dataset in your research or project, please cite it as follows:
|
| 125 |
+
|
| 126 |
+
```bibtex
|
| 127 |
+
@misc{fscdmini2025,
|
| 128 |
+
author = {Jugal Gajjar, Kamalasankari Subramaniakuppusamy, Kaustik Ranaware},
|
| 129 |
+
title = {Filtered CodeStar Dataset Mini},
|
| 130 |
+
year = {2025},
|
| 131 |
+
publisher = {HuggingFace},
|
| 132 |
+
howpublished = {\url{https://huggingface.co/datasets/jugalgajjar/Filtered-StarCoder-Dataset-Mini}}
|
| 133 |
+
}
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
## License
|
| 137 |
+
|
| 138 |
+
This dataset is released under the MIT License. See the LICENSE file for more details.
|