You need to agree to share your Hugging Face information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

Dataset Card for Java Pretraining Corpus

Dataset Summary

This dataset is a Java-focused corpus assembled to pretrain a randomly initialized T5 model using span corruption before fine-tuning on two code-review automation tasks: code&comment2code and code2comment. It is independent of the assignment-provided fine-tuning data.

The corpus combines Java methods, Javadoc-plus-method examples, and commit subjects. The resulting distribution is intentionally code-heavy to support Java method revision. Javadoc and commit subjects add natural-language context but are not direct substitutes for human reviewer comments. No pull-request review discussions were mined.

The final corpus contains 448,533 instances. Each has 10 to 512 tokens under the project tokenizer, including EOS when lengths were measured.

Length statistic Tokens
Mean 81.22
Median 38
90th percentile 209
99th percentile 460
Maximum 512

Dataset Details

Intended Uses

The primary intended use is self-supervised span-corruption pretraining for a T5-style model, followed by fine-tuning on Java code-review automation. The corpus can also support research on code-oriented tokenization and the effects of source composition on downstream code and natural-language generation.

It is not labeled with code review outcomes, and its records should not be interpreted as verified code fixes, reviewer judgments, or guaranteed secure implementations.

Repository Sampling Frame

The repository sampling frame came from a SEART GitHub Search export captured on 2026-10-12. The exact search filters and deterministic local selection procedure are recorded in corpus/ghs_query.txt. The original export is corpus/ghs_results.csv.

Selection stage Repositories
GHS export 3,766
Locally eligible 3,602
Selected 200
Successful checkouts 190
Failed checkouts 10

Eligible repositories were sorted by name, shuffled using seed 680, and the first 200 were selected. Requested commit SHAs are recorded in corpus/repositories.csv.

A checkout was accepted only if its conventional root license file contained recognizable MIT license text and its checked-out commit matched the requested SHA. This is a repository-level license check, not proof that every vendored or separately licensed file is MIT licensed. Extraction excluded common generated, build, test, and vendor directories. Later curation removed recognized generated/vendor paths and available non-MIT file flags or headers.

Dataset Structure

Instance Types

Instance type Final count
commit_subject 30,869
java_method 382,257
javadoc_method 35,407
Total 448,533
  • java_method: Extracted Java method and constructor text, providing the primary code distribution.
  • javadoc_method: Javadoc text paired with a method, exposing code and descriptive natural language together.
  • commit_subject: Short English text associated with code changes, but not necessarily reviewer-style feedback.

Schema note: Exact dataset file names and serialized column names are not specified in this card's source documentation. Consult the uploaded corpus files before assuming a particular datasets.load_dataset() configuration or column schema.

Pretraining Split

The final corpus was split deterministically with seed 680.

Split Instances
Training 444,037
Held out (approximately 1%) 4,496
Total 448,533

Prepared token arrays exclude EOS. The span-corruption pipeline appends EOS to both the encoder input and decoder target.

Dataset Creation

Collection and Processing

Extraction at selected repository revisions produced 799,401 records from Java methods and constructors, Javadoc-plus-method pairs, and commit subjects.

The processing stages were applied in this order:

  1. Exact deduplication: SHA-256 after whitespace normalization removed 130,094 records.
  2. Near-duplicate removal: MinHash/LSH on five-token-shingle sets, followed by exact Jaccard verification at a threshold of 0.85, removed 131,149 additional records. LSH candidate discovery is approximate and may miss near duplicates. Candidate overflow counts are retained in the deduplication report.
  3. Validation/test decontamination: Removed 236 records according to the matching policy described below.
  4. Quality filtering: Removed records containing control characters, generated/vendor paths, explicit non-MIT file flags or headers, excessive length, or short uninformative prose. The assigned removal reason is recorded once per record in corpus/processed/curation_report.json and corpus/processed/curation_audit.jsonl.
  5. Tokenizer-based length filtering: Discarded 19,420 records shorter than 10 tokens and 42,141 longer than 512 tokens. These records were discarded, not truncated.

The stage-by-stage input, removal, and remaining counts are documented in corpus/counts.csv, which is the authoritative accounting record for the pipeline.

Validation and Test Decontamination

Protected references were constructed from both tasks' validation and test splits, not their training splits.

For code editing, the protected union included the submitted method with <START> and <END> markers removed, the revised method, and the reviewer comment. For code-to-comment, it included the input method and reviewer comment.

  • Method matching: Whitespace-collapsed exact comparisons and complete-method substring matching inside longer records, with no minimum method-length threshold.
  • Reviewer comments: Whitespace-collapsed exact complete-comment matches and exact matches of separately identified comment units at any length.
  • Reviewer-comment substrings: Lexical token-boundary matching requiring at least five word-like tokens.
  • AST matching: Disabled.

The five-word-like-token threshold reduces incidental matches from short, common phrases. However, short reviewer-comment substrings are not removed unless they match a complete comment or an identified comment unit. This is a deliberate precision-versus-coverage tradeoff.

Exact protected-reference counts and removal reasons are documented in the curation report. Decontamination reduces detectable overlap under these rules; it is not a guarantee that every semantic or near-duplicate overlap has been removed.

Use of assignment data: No fine-tuning examples were used to train the tokenizer or pretraining model. Validation and test data were used for overlap filtering and, after final model selection, evaluation and sequence-length analysis.

Tokenizer

A fresh 32,000-token ByteLevel BPE tokenizer was trained only on the curated mined corpus. This tokenizer was selected to represent Java punctuation and identifiers while learning recurring code fragments and balancing vocabulary size against token fragmentation.

The tokenizer includes T5's 100 sentinel tokens, task markers <START> and <END>, and source tags used by the provided examples.

Tokenizer SHA-256:

2df56303a86dbcc66d094ecadbeef0d3a9453e25b1ae15fc58beef096d266c30

Fine-tuning Sequence-Length Policy

Final task length statistics, including prefixes and EOS, are in results/part1/length_statistics.json and results/part1/length_statistics.csv for training, validation, and test.

During fine-tuning, overlength inputs and targets are truncated to 511 content tokens plus EOS, rather than dropping the example.

Fine-tuning split Truncated sources Truncated targets
Joint training 867 149
Validation 76 11

Test-set overlength counts are available in the length statistics files. Three complete tokenized examples are recorded in results/part1/tokenized_examples.json, and identifier segmentation examples in results/part1/identifier_examples.json.

Uses

Appropriate Uses

  • Self-supervised pretraining for Java-aware text-to-text models.
  • Controlled research on the effect of pretraining on Java code editing and comment generation.
  • Analysis of code and natural-language mixture, tokenization, deduplication, and decontamination.

Reproducibility and Supporting Artifacts

The following paths refer to the project workspace. They are not automatically accessible from this Hugging Face repository unless the corresponding files are uploaded.

Project artifact Purpose
corpus/ghs_query.txt GHS filters and deterministic selection procedure
corpus/ghs_results.csv Original 3,766-repository export
corpus/repositories.csv Selected repositories and requested commit SHAs
corpus/counts.csv Stage-by-stage extraction and filtering accounting
corpus/processed/curation_report.json Curation and protected-reference counts
corpus/processed/curation_audit.jsonl Per-record removal audit
results/part1/length_statistics.json and .csv Task length and truncation statistics
results/part1/tokenized_examples.json Three tokenized corpus examples
results/part1/identifier_examples.json Identifier segmentation examples
results/pretraining/ Training/holdout losses, masked-token accuracy, mean span length, token counts, and GPU-hour estimates

The random seed used for repository selection and pretraining split construction was 680.

Downloads last month
12