Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,29 +1,149 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
download_size: 1232477
|
| 23 |
-
dataset_size: 2760440
|
| 24 |
-
configs:
|
| 25 |
-
- config_name: default
|
| 26 |
-
data_files:
|
| 27 |
-
- split: train
|
| 28 |
-
path: data/train-*
|
| 29 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- code
|
| 4 |
+
- en
|
| 5 |
+
license:
|
| 6 |
+
- mit
|
| 7 |
+
- apache-2.0
|
| 8 |
+
- bsd
|
| 9 |
+
tags:
|
| 10 |
+
- code
|
| 11 |
+
- pretraining
|
| 12 |
+
- code-generation
|
| 13 |
+
- instruct
|
| 14 |
+
- luck-spark
|
| 15 |
+
- moe
|
| 16 |
+
- 1b
|
| 17 |
+
size_categories:
|
| 18 |
+
- 10K<n<100K
|
| 19 |
+
task_categories:
|
| 20 |
+
- text-generation
|
| 21 |
+
pretty_name: Luck Spark 1B - High Quality Code Dataset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
---
|
| 23 |
+
|
| 24 |
+
# Luck Spark 1B - High Quality Code Dataset
|
| 25 |
+
|
| 26 |
+
**The first quality-scored, star-agnostic code dataset for training 1B MoE code models.**
|
| 27 |
+
|
| 28 |
+
Unlike The Stack / CodeParrot that filter by stars, this dataset scores every file **by its content (0-10)**. A 2-star well-documented library scores higher than a 10k-star minified file. Continuously updated by an autonomous bot.
|
| 29 |
+
|
| 30 |
+
**Repo:** `ahmetggg/luck-spark-1b-code-dataset` | **Bot:** `github_to_hf_bot.py` | **License:** Permissive only (MIT / Apache-2.0 / BSD / Unlicense)
|
| 31 |
+
|
| 32 |
+
## Why This Dataset is Different?
|
| 33 |
+
|
| 34 |
+
| Feature | This Dataset | Others (Stack, etc.) |
|
| 35 |
+
|---------|--------------|----------------------|
|
| 36 |
+
| **Filter** | Content Quality Score 0-10 | Stars > 100 |
|
| 37 |
+
| **Low-star gems** | ✅ Kept if quality 7+ | ❌ Discarded |
|
| 38 |
+
| **Quality transparency** | `score` column for every file | No score |
|
| 39 |
+
| **Dedup** | SHA256 + diversity check | Basic |
|
| 40 |
+
| **Execution check** | AST parse + structure | None |
|
| 41 |
+
| **Live** | Bot updates daily | Static dump |
|
| 42 |
+
|
| 43 |
+
**Quality Score (0-10) breakdown:**
|
| 44 |
+
- `+3` AST parse + has function/class + docstring
|
| 45 |
+
- `+2` Comment ratio 5-40% (documented, not spam)
|
| 46 |
+
- `+1` Ideal size 500-20k chars
|
| 47 |
+
- `+1` Diversity (unique lines >60%)
|
| 48 |
+
- `+1` Weak star bonus `log10(stars+1)*0.5` (max 1 point)
|
| 49 |
+
- `- fail` minified, auto-generated, binary, 0/50 diversity
|
| 50 |
+
|
| 51 |
+
- `score <5` → discarded (trash)
|
| 52 |
+
- `score 5-7` → kept locally, not pushed (medium)
|
| 53 |
+
- `score 7+` → **pushed to HF** (high quality only)
|
| 54 |
+
|
| 55 |
+
You can see the exact scorer: `quality_score()` in `github_to_hf_bot.py:26`
|
| 56 |
+
|
| 57 |
+
## Dataset Structure
|
| 58 |
+
|
| 59 |
+
```python
|
| 60 |
+
{
|
| 61 |
+
"text": "import math\nclass Calculator:\n ...", # raw code
|
| 62 |
+
"repo": "ahmetggg/example-repo", # source repo
|
| 63 |
+
"path": "src/calc.py", # file path
|
| 64 |
+
"language": ".py", # .py/.js/.rs/.go/.java/.cpp/.ts
|
| 65 |
+
"hash": "a1b2c3d4e5f6g7h8", # SHA256 dedup
|
| 66 |
+
"score": 7.4, # 0-10 quality
|
| 67 |
+
"stars": 12 # repo stars at scrape time
|
| 68 |
+
}
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
**Languages:** Python, JavaScript, Rust, Go, Java, C++, TypeScript (balanced, no star bias)
|
| 72 |
+
|
| 73 |
+
## Usage
|
| 74 |
+
|
| 75 |
+
```python
|
| 76 |
+
from datasets import load_dataset
|
| 77 |
+
|
| 78 |
+
# Load high-quality only (7+ already filtered)
|
| 79 |
+
ds = load_dataset("ahmetggg/luck-spark-1b-code-dataset")
|
| 80 |
+
print(ds)
|
| 81 |
+
# DatasetDict({ train: Dataset({ num_rows: 1000+, features: [...] }) })
|
| 82 |
+
|
| 83 |
+
# Filter even stricter (e.g., 8+)
|
| 84 |
+
high = ds["train"].filter(lambda x: x["score"] >= 8)
|
| 85 |
+
print(f"Elite: {len(high)} files")
|
| 86 |
+
|
| 87 |
+
# Language split
|
| 88 |
+
py = ds["train"].filter(lambda x: x["language"] == ".py")
|
| 89 |
+
|
| 90 |
+
# For pretraining (raw text)
|
| 91 |
+
from transformers import AutoTokenizer
|
| 92 |
+
tok = AutoTokenizer.from_pretrained("ahmetggg/luck-spark-1b")
|
| 93 |
+
texts = ds["train"]["text"]
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
**For Luck Spark 1B training:**
|
| 97 |
+
```bash
|
| 98 |
+
# Pretrain: use raw text
|
| 99 |
+
# Instruct: use text + auto-generated instruction (coming soon)
|
| 100 |
+
# RL: execution-verified subset (score 8+)
|
| 101 |
+
```
|
| 102 |
+
|
| 103 |
+
## Stats (Live)
|
| 104 |
+
|
| 105 |
+
- **Total repos scanned:** 616+ (7 languages × 3 pages, growing)
|
| 106 |
+
- **Files kept:** ~60% (0/50 for trash repos, 34/50 for gems)
|
| 107 |
+
- **Avg score:** 6.2 - 7.6 (pushed avg >7.0)
|
| 108 |
+
- **Dedup:** SHA256, ~5% duplicates removed
|
| 109 |
+
- **Licenses:** MIT / Apache-2.0 / BSD / Unlicense only (commercial safe)
|
| 110 |
+
|
| 111 |
+
*Updated continuously. Last bot run: see commit history.*
|
| 112 |
+
|
| 113 |
+
## Collection Method
|
| 114 |
+
|
| 115 |
+
1. GitHub Search API: `language:python license:mit` (no star filter, `sort:updated`)
|
| 116 |
+
2. Tree API: max 50 files / repo, `<500KB`, allowed extensions
|
| 117 |
+
3. Raw download + `quality_score()` -> keep 5+, push 7+
|
| 118 |
+
4. Arrow/Parquet -> `push_to_hub` every 1000 files
|
| 119 |
+
|
| 120 |
+
No manual curation. Fully autonomous, reproducible.
|
| 121 |
+
|
| 122 |
+
## Limitations & Ethics
|
| 123 |
+
|
| 124 |
+
- Only permissive licenses. No GPL/copyleft. Check `repo` field before commercial use.
|
| 125 |
+
- Code may contain biases from GitHub. Filter `score` for your use-case.
|
| 126 |
+
- No PII scrubbing beyond GitHub public data. Report issues via Discussions.
|
| 127 |
+
|
| 128 |
+
## Citation
|
| 129 |
+
|
| 130 |
+
```bibtex
|
| 131 |
+
@dataset{luck_spark_1b_2026,
|
| 132 |
+
title={Luck Spark 1B High Quality Code Dataset},
|
| 133 |
+
author={ahmetggg},
|
| 134 |
+
year={2026},
|
| 135 |
+
publisher={Hugging Face},
|
| 136 |
+
url={https://huggingface.co/datasets/ahmetggg/luck-spark-1b-code-dataset}
|
| 137 |
+
}
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
## Roadmap
|
| 141 |
+
|
| 142 |
+
- [x] Quality-scored v1 (7+ push)
|
| 143 |
+
- [ ] Execution-verified subset (`python -m py_compile` + tests)
|
| 144 |
+
- [ ] Instruction pairs (`explain this code` / `complete this function`)
|
| 145 |
+
- [ ] 100B tokens target for 1B MoE pretraining
|
| 146 |
+
|
| 147 |
+
Built for **Luck Spark 1B (Mamba + MoE, Executor + Architect)** - open source, HF first.
|
| 148 |
+
|
| 149 |
+
*Questions? Open a Discussion on HF or check `github_to_hf_bot.py` for the exact logic.*
|