Update README.md
Browse files23 unmodified lines2425262728293031323318 unmodified lines5253545556575859606118 unmodified lines8081828384858687888922 unmodified lines11211311411511611711811912012118 unmodified lines14014114214314414514614714814918 unmodified lines16816917017117217317417517617718 unmodified lines19619719819920020120220320420518 unmodified lines22422522622722822923023123223318 unmodified lines25225325425525625725825926026118 unmodified lines28028128228328428528628728828918 unmodified lines30830931031131231331431531631718 unmodified lines33633733833934034134234334434518 unmodified lines36436536636736836937037137237318 unmodified lines39239339439539639739839940040118 unmodified lines42042142242342442542642742842956 unmodified lines48648748823 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 8463845num_examples: 45769download_size: 4133304dataset_size: 8463845- config_name: CSharpfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 10799062num_examples: 53304download_size: 5229026dataset_size: 10799062- config_name: Cppfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 25495370num_examples: 131729download_size: 12327512dataset_size: 25495370- config_name: Gofeatures:- name: blob_id22 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 1289738num_examples: 5978download_size: 504218dataset_size: 1289738- config_name: Javafeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 131964268num_examples: 606520download_size: 65086760dataset_size: 131964268- config_name: JavaScriptfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 28682940num_examples: 143959download_size: 13628578dataset_size: 28682940- config_name: Markdownfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 114451402num_examples: 547852download_size: 54229584dataset_size: 114451402- config_name: PHPfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 4305039num_examples: 22365download_size: 1987572dataset_size: 4305039- config_name: Pythonfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 89313081num_examples: 458826download_size: 43846401dataset_size: 89313081- config_name: Rubyfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 722353num_examples: 3862download_size: 308486dataset_size: 722353- config_name: Rustfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 288366num_examples: 1494download_size: 117297dataset_size: 288366- config_name: SQLfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 6647337num_examples: 34493download_size: 3227395dataset_size: 6647337- config_name: Shellfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 1019999num_examples: 5371download_size: 456837dataset_size: 1019999- config_name: Swiftfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 8229529num_examples: 37726download_size: 3715589dataset_size: 8229529- config_name: TypeScriptfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 4690102num_examples: 22948download_size: 2080678dataset_size: 4690102configs:- config_name: Cdata_files:56 unmodified lines- split: trainpath: TypeScript/train-*---23 unmodified lines2425262728293031323318 unmodified lines5253545556575859606118 unmodified lines8081828384858687888922 unmodified lines11211311411511611711811912012118 unmodified lines14014114214314414514614714814918 unmodified lines16816917017117217317417517617718 unmodified lines19619719819920020120220320420518 unmodified lines22422522622722822923023123223318 unmodified lines25225325425525625725825926026118 unmodified lines28028128228328428528628728828918 unmodified lines30830931031131231331431531631718 unmodified lines33633733833934034134234334434518 unmodified lines36436536636736836937037137237318 unmodified lines39239339439539639739839940040118 unmodified lines42042142242342442542642742842956 unmodified lines48648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561623 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 1100442974num_examples: 5848375download_size: 571816053dataset_size: 1100442974- config_name: CSharpfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 2392066248num_examples: 11425016download_size: 1232015539dataset_size: 2392066248- config_name: Cppfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 3167426435num_examples: 16246746download_size: 1632803797dataset_size: 3167426435- config_name: Gofeatures:- name: blob_id22 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 433053889num_examples: 1917163download_size: 179388495dataset_size: 433053889- config_name: Javafeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 10292427437num_examples: 44990158download_size: 5291667797dataset_size: 10292427437- config_name: JavaScriptfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 2654326008num_examples: 13253431download_size: 1287066511dataset_size: 2654326008- config_name: Markdownfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 4268378053num_examples: 20687077download_size: 2058772192dataset_size: 4268378053- config_name: PHPfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 1985843762num_examples: 9914497download_size: 983498806dataset_size: 1985843762- config_name: Pythonfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 4947575770num_examples: 25286019download_size: 2500795086dataset_size: 4947575770- config_name: Rubyfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 592832039num_examples: 2976874download_size: 284535771dataset_size: 592832039- config_name: Rustfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 227434676num_examples: 1135379download_size: 103158397dataset_size: 227434676- config_name: SQLfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 505669712num_examples: 2504412download_size: 261176608dataset_size: 505669712- config_name: Shellfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 811611733num_examples: 4133547download_size: 394872047dataset_size: 811611733- config_name: Swiftfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 529873695num_examples: 2454309download_size: 257883733dataset_size: 529873695- config_name: TypeScriptfeatures:- name: blob_id18 unmodified linesdtype: large_stringsplits:- name: trainnum_bytes: 904736029num_examples: 4290356download_size: 425942502dataset_size: 904736029configs:- config_name: Cdata_files:56 unmodified lines- split: trainpath: TypeScript/train-*---[HuggingFaceTB/stack-edu](https://huggingface.co/datasets/HuggingFaceTB/stack-edu) 에서 한국어가 포함된 데이터만 발췌- 주석이나 소스코드 내부에 한국어가 포함된 경우- 한국어로 작성된 문서(Markdown 등)**특징**- **한글이 5글자 이상** 들어있으면 한국어가 포함된 데이터라고 판단함- 극소수지만 한국어가 아닌데 유니코드가 깨져서 우연히 한글이 검출된 경우도 있는 것 같음- [SmolLM2](HuggingFaceTB/SmolLM2-1.7B-Instruct) 토크나이저 기준 토큰 수 비교 (총 125B -> 4.1B, 마크다운 제외 시 2.1B)| Language | Stack-Edu (B tokens) | Stack-Edu-Ko (M tokens) ||------------|----------------------|-------------------------|| Python | 21.8 | 430.8 || Cpp | 16.0 | 187.4 || Markdown | 14.0 | 1990.9 || C | 11.1 | 76.5 || JavaScript | 11.1 | 179.6 || Java | 42.1 | 810.5 || SQL | 9.62 | 240.1 || PHP | 9.07 | 32.2 || C-Sharp | 8.87 | 66.8 || TypeScript | 3.03 | 23.4 || Shell | 3.13 | 8.5 || Swift | 1.83 | 41.6 || Go | 1.80 | 6.5 || Rust | 1.75 | 5.2 || Ruby | 1.61 | 4.2 |# 💻 Stack-EduStack-Edu is a 125B token dataset of educational code filtered from [The Stack v2](https://huggingface.co/datasets/bigcode/the-stack-v2), precisely the curated training corpus of [StarCoder2](https://arxiv.org/abs/2402.19173) models denoted StarCoder2Data. It is intended for Language Models training.This dataset was curated using a classifier-based filtering strategy, inspired by [📚 FineWeb-Edu](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu), to retain only the highest-quality educational programming content.Stack-Edu shows consistent improvement over StarCoder2data on all the programming languages on MultiPL-E benchmark.<img src="https://cdn-uploads.huggingface.co/production/uploads/61c141342aac764ce1654e43/GWnPgD0diMu0I8buK6mvG.png" width="600"/>## Downloading the dataThis dataset only contains the SWHIDs to download the code files and not the content of the files itself. The contents can be downloaded from Software Heritage's S3 bucket to ensure data compliance.Please refer to [the-stack-v2](https://huggingface.co/datasets/bigcode/the-stack-v2-train-full-ids) for the data license.When running on a 16-core AWS `us-east-1` instance, this script takes ~6 hours to download the files:```pythonimport boto3import gzipfrom datasets import load_datasetfrom botocore.exceptions import ClientErrornum_proc = 16s3 = boto3.client('s3')bucket_name = "softwareheritage"def download_contents(blob_id):key = f"content/{blob_id}"try:obj = s3.get_object(Bucket=bucket_name, Key=key)with gzip.GzipFile(fileobj=obj['Body']) as fin:content = fin.read().decode("utf-8", errors="ignore")return {"text": content, "download_success": True}except ClientError as e:if e.response['Error']['Code'] == 'NoSuchKey':print(f"File not found: {key}")return {"text": "", "download_success": False}else:raise# For Pythonds = load_dataset("HuggingFaceTB/stack-edu", "Python", split="train", num_proc=num_proc)ds = ds.map(download_contents, input_columns="blob_id", num_proc=num_proc)# Filter out failed downloadsds = ds.filter(lambda x: x['download_success'])# Optionally, print the first example to verify the dataprint(ds[0])```## DetailsThe table below shows the number of tokens in each programming language using [SmolLM2](https://huggingface.co/HuggingFaceTB/SmolLM2-1.7B-Instruct) tokenizer.| Language | Stack-Edu (B tokens) ||------------|----------------------|| Python | 21.8 || Cpp | 16.0 || Markdown | 14.0 || C | 11.1 || JavaScript | 11.1 || Java | 42.1 || SQL | 9.62 || PHP | 9.07 || C-Sharp | 8.87 || TypeScript | 3.03 || Shell | 3.13 || Swift | 1.83 || Go | 1.80 || Rust | 1.75 || Ruby | 1.61 |## Dataset curationTo build Stack-Edu, we:- Selected 15 largest programming languages from StarCoder2Data- Trained 15 language-specific classifiers, using [StarEncoder](https://huggingface.co/bigcode/starencoder) model on synthetic annotations generated by Llama3-70B-Instruct. The classifiers for each language are available in this [collection](https://huggingface.co/collections/HuggingFaceTB/the-ultimate-collection-of-code-classifiers-67b5aa3eb8994a4b71453005).- Applied a filtering threshold of 3 (out of 5) to retain highly educational content, except for Java, which performed best at threshold 2.## Citation Information```@misc{allal2025smollm2smolgoesbig,title={SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model},author={Loubna Ben Allal and Anton Lozhkov and Elie Bakouch and Gabriel Martín Blázquez and Guilherme Penedo and Lewis Tunstall and Andrés Marafioti and Hynek Kydlíček and Agustín Piqueres Lajarín and Vaibhav Srivastav and Joshua Lochner and Caleb Fahlgren and Xuan-Son Nguyen and Clémentine Fourrier and Ben Burtenshaw and Hugo Larcher and Haojun Zhao and Cyril Zakka and Mathieu Morlon and Colin Raffel and Leandro von Werra and Thomas Wolf},year={2025},eprint={2502.02737},archivePrefix={arXiv},primaryClass={cs.CL},url={https://arxiv.org/abs/2502.02737},}```
README.md+188-60