Sm0r3s commited on
Commit
3ee36f6
·
verified ·
1 Parent(s): b93c291

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -43
README.md CHANGED
@@ -1,43 +1,26 @@
1
- ---
2
- dataset_info:
3
- features:
4
- - name: language
5
- dtype: string
6
- - name: tier
7
- dtype: string
8
- - name: quality_score
9
- dtype: float64
10
- - name: char_count
11
- dtype: int64
12
- - name: requires_version_context
13
- dtype: bool
14
- - name: version_context
15
- dtype: string
16
- - name: code
17
- dtype: string
18
- - name: metadata
19
- struct:
20
- - name: source
21
- dtype: string
22
- - name: repo_name
23
- dtype: string
24
- - name: file_path
25
- dtype: string
26
- - name: licenses
27
- list: string
28
- - name: size_bytes
29
- dtype: int64
30
- - name: details
31
- dtype: string
32
- splits:
33
- - name: train
34
- num_bytes: 388634996
35
- num_examples: 97767
36
- download_size: 151622359
37
- dataset_size: 388634996
38
- configs:
39
- - config_name: default
40
- data_files:
41
- - split: train
42
- path: data/train-*
43
- ---
 
1
+ pretty_name: Bookbearer Modern Code (v5)
2
+ license: other
3
+ task_categories:text-generationfill-mask
4
+ language:code
5
+ tags:codeprogrammingmodern-codequality-filteredversion-awarebookbearerpythonjavascripttypescriptrustjavacppthe-stack-dedup
6
+ size_categories:10K<n<100KBookbearer Modern Code (v5)Bookbearer Modern Code is a token-balanced, version-aware, quality-scored source code corpus curated from bigcode/the-stack-dedup for training and fine-tuning code language models.Rather than treating all permissively licensed code equally, this dataset filters out deprecated APIs, legacy boilerplate, and auto-generated exports, scores each file on structural and idiomatic quality, and tags every example with a version tier (modern, timeless, or legacy) alongside machine-readable version context.Dataset SummaryTotal Files: 97,767Estimated Tokens: ~90.97M (approx. 4 chars/token)Languages: Python, JavaScript, TypeScript, Rust, Java, C++Upstream Source: bigcode/the-stack-dedupMetadata Coverage: 100% (repo_name and licenses present on all 97,767 records)Language DistributionFive core languages are balanced to ~17.5M estimated tokens each. C++ is included at ~3.47M tokens due to stricter filtering against C-style memory management (malloc/free, NULL) and legacy headers within the scan cap.LanguageFilesEst. TokensAvg Quality ScoreFiles Scored ≥80Python14,41817,501,56570.61,820JavaScript28,73117,500,00572.73,925TypeScript26,58117,500,00770.64,701Rust13,98917,501,18075.24,048Java12,08117,500,50069.4107C++1,9673,468,49171.1423Total97,76790,971,74871.615,024Version Tier DistributionEvery file is classified into one of three tiers to support curriculum learning, version-conditioned generation, or code modernization tasks:TierFilesShareDescriptionmodern66,74668.3%Uses contemporary language features, idioms, and active APIs.timeless26,99827.6%Clean, idiomatic code with no strong version-specific signals.legacy4,0234.1%Clean, readable older patterns retained explicitly with modernization_targets metadata.Dataset StructureFieldscontent (string): The full source code of the file.language (string): Programming language (python, javascript, typescript, rust, java, cpp).tier (string): Version classification (modern, timeless, legacy).quality_score (float): Composite heuristic quality score (0–100) reflecting structure, readability, typing/annotations, and idiomatic usage.version_context (string): JSON-encoded dictionary containing language-specific version metadata (e.g., min_version, recommended, max_recommended_version, modernization_targets).metadata (struct): Upstream provenance and scoring details:source: Upstream dataset identifier (bigcode/the-stack-dedup).repo_name: Original GitHub repository name.file_path: Relative path of the file within the repository.licenses: List of permissive SPDX license identifiers from upstream.details: JSON-encoded dictionary of language-specific heuristic signals (e.g., annotation_ratio, module_format).Note on JSON-encoded fields: version_context and metadata.details are stored as JSON strings to preserve a uniform Apache Arrow schema across languages with different feature keys. Parse them with json.loads() when inspecting individual fields.UsageStreaming / Loadingimport json
7
+ from datasets import load_dataset
8
+
9
+ ds = load_dataset("Sm0r3s/bookbearer-modern-code", split="train", streaming=True)
10
+ sample = next(iter(ds))
11
+
12
+ print(sample["language"], sample["tier"], sample["quality_score"])
13
+ print("Version context:", json.loads(sample["version_context"]))
14
+ print("Repo:", sample["metadata"]["repo_name"], "| Licenses:", sample["metadata"]["licenses"])
15
+ Filtering for High-Quality Modern Codefrom datasets import load_dataset
16
+
17
+ ds = load_dataset("Sm0r3s/bookbearer-modern-code", split="train")
18
+
19
+ # Example: high-scoring modern & timeless Python and Rust files
20
+ high_quality = ds.filter(
21
+ lambda row: row["language"] in {"python", "rust"}
22
+ and row["tier"] in {"modern", "timeless"}
23
+ and row["quality_score"] >= 80.0
24
+ )
25
+ print(f"Filtered examples: {len(high_quality):,}")
26
+ Curation & Filtering MethodologyDeduplicated Permissive Base: Streamed from bigcode/the-stack-dedup across 6 target languages.Deprecation & Artifact Removal: Rejected files containing obsolete/deprecated frameworks and syntax (e.g., Python 2 constructs, tf.compat.v1, Jupyter # In[1]: exports, legacy C-style memory management in C++).Version-Aware Tiering: Tagged each accepted file as modern, timeless, or legacy, attaching structured version_context and modernization_targets where applicable.Quality Scoring: Scored files using language-specific static heuristics (type annotation coverage, module conventions, structural cleanliness, comment/code balance).Token-Budget Balancing: Capped each language by character budget (~70M characters / ~17.5M estimated tokens) to prevent verbose or high-volume languages from dominating the corpus.Licensing & AttributionThis dataset is a curated derivative of bigcode/the-stack-dedup. Each record retains its original repo_name, file_path, and permissive SPDX licenses list in the metadata field. Downstream users are responsible for complying with the individual permissive licenses (e.g., MIT, Apache-2.0, BSD-3-Clause) and upstream attribution requirements of the included repositories.Limitations & Future WorkC++ Volume: C++ currently accounts for ~3.47M tokens (1,967 files) compared to ~17.5M tokens for the other five languages. A dedicated C++ expansion pass is planned for a future revision.Heuristic Scoring: Quality scores are computed via static, language-specific heuristics rather than execution-based testing or compiler/type-checker verification.