Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
arrow
Languages:
code
Size:
10M - 100M
ArXiv:
License:
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- code
|
| 4 |
+
- github
|
| 5 |
+
- commits
|
| 6 |
+
- multilingual
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
task_categories:
|
| 9 |
+
- text-generation
|
| 10 |
+
language:
|
| 11 |
+
- code
|
| 12 |
+
size_categories:
|
| 13 |
+
- 10M<n<100M
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
<div align="center">
|
| 17 |
+
|
| 18 |
+
# Themis-Git-Commits
|
| 19 |
+
|
| 20 |
+
[](https://arxiv.org/abs/xxxx.xxxxx)
|
| 21 |
+
[](https://huggingface.co/collections/project-themis/themis-reward-model-collection)
|
| 22 |
+
[](https://huggingface.co/collections/project-themis/themis-preference-datasets-and-benchmarks)
|
| 23 |
+
[](https://github.com/iNeil77/Themis)
|
| 24 |
+
|
| 25 |
+
</div>
|
| 26 |
+
|
| 27 |
+
## Overview
|
| 28 |
+
|
| 29 |
+
**Themis-Git-Commits** is a large-scale dataset of single-file code commits mined from openly licensed GitHub repositories via the [BigQuery GitHub public dataset](https://console.cloud.google.com/marketplace/product/github/github-repos). This is the **raw commit dataset** — prior to merging with pull request data to subset only for merged commits. It serves as the foundational data source for the commit-based preference pairs in [Themis-CodePreference](https://huggingface.co/collections/project-themis/themis-preference-datasets-and-benchmarks), which is used to train the [Themis-RM](https://huggingface.co/collections/project-themis/themis-reward-model-collection) suite of multilingual code reward models.
|
| 30 |
+
|
| 31 |
+
Each row represents a single commit that changes exactly one file in a repository with a permissive open-source license. The dataset includes the commit metadata (SHA, message, timestamp, license) along with the pre-commit and post-commit file contents, enabling downstream construction of code-change preference pairs across multiple quality dimensions.
|
| 32 |
+
|
| 33 |
+
## Collection Pipeline
|
| 34 |
+
|
| 35 |
+
The commit mining pipeline is described in detail in the [Themis paper](https://arxiv.org/abs/xxxx.xxxxx) and the [Dataset](https://github.com/iNeil77/Themis/tree/main/Dataset) folder in the GitHub repository. At a high level:
|
| 36 |
+
|
| 37 |
+
1. **BigQuery Mining** — A [GoogleSQL query](https://github.com/iNeil77/Themis/blob/main/Dataset/Commit_Mining_SQL/consolidated_query.sql) extracts single-file commits from `bigquery-public-data.github_repos`, filtering for permissive licenses, target programming languages, and non-trivial commit messages.
|
| 38 |
+
|
| 39 |
+
2. **Repository Reputation Filtering** — Commits are subset to those originating from [curated high-reputation repositories](https://github.com/iNeil77/Themis/tree/main/Dataset/Repos) (15+ GitHub stars, 5+ contributors, 10+ issues).
|
| 40 |
+
|
| 41 |
+
3. **Extension Filtering** — Commits are further filtered so the changed file's extension matches a target programming language.
|
| 42 |
+
|
| 43 |
+
4. **Content Retrieval** — The pre-commit (`old_contents`) and post-commit (`new_contents`) file contents are fetched from GitHub via shallow git fetches using [retrieve_commit_contents.py](https://github.com/iNeil77/Themis/blob/main/Dataset/Utils/retrieve_commit_contents.py).
|
| 44 |
+
|
| 45 |
+
5. **MinHash Deduplication** — Near-duplicate content is removed using [MinHash LSH deduplication](https://github.com/iNeil77/Themis/blob/main/Dataset/Utils/minHash_dedupe_local.py) (shingle size 5, 256 permutations, Jaccard threshold 0.7).
|
| 46 |
+
|
| 47 |
+
## Downstream Processing (Not in This Dataset)
|
| 48 |
+
|
| 49 |
+
The steps below are applied downstream to produce the final preference pairs in Themis-CodePreference, and are **not** reflected in this raw dataset:
|
| 50 |
+
|
| 51 |
+
- **Pull Request Merging** — Commits are cross-referenced with GHTorrent pull request data to retain only non-reverted commits that are part of successfully merged pull requests, ensuring implicit human validation.
|
| 52 |
+
- **Aspect Classification** — Commits are assigned to quality dimensions (Functional Correctness, Runtime Efficiency, Memory Efficiency, Security Hardness, Readability & Maintainability) using criteria-specialized [ModernBERT](https://huggingface.co/answerdotai/ModernBERT-base) commit classifiers, trained on seed positives retrieved via [curated term lists](https://github.com/iNeil77/Themis/tree/main/Dataset/Commit_Mining_Terms).
|
| 53 |
+
- **LLM Scoring & Instruction Synthesis** — Frontier LMs validate preference strength and generate realistic inverse instructions.
|
| 54 |
+
- **LLM-as-a-Judge Preference Labelling** — Multi-sample voting with frontier LMs produces consensus preference labels.
|
| 55 |
+
|
| 56 |
+
## Dataset Schema
|
| 57 |
+
|
| 58 |
+
<div align="center">
|
| 59 |
+
|
| 60 |
+
| Column | Type | Description |
|
| 61 |
+
|:---|:---:|:---|
|
| 62 |
+
| `commit` | string | Git commit SHA |
|
| 63 |
+
| `subject` | string | First line of the commit message |
|
| 64 |
+
| `message` | string | Full commit message body |
|
| 65 |
+
| `repos` | string | Comma-separated list of repository names containing this commit |
|
| 66 |
+
| `file_path` | string | Path of the changed file |
|
| 67 |
+
| `license` | string | SPDX license identifier of the source repository |
|
| 68 |
+
| `unix_time` | int64 | Committer timestamp (seconds since epoch) |
|
| 69 |
+
| `new_contents` | string | File contents after the commit (post-commit) |
|
| 70 |
+
| `old_contents` | string | File contents before the commit (pre-commit) |
|
| 71 |
+
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
## Filters Applied During Mining
|
| 75 |
+
|
| 76 |
+
<div align="center">
|
| 77 |
+
|
| 78 |
+
| Filter | Purpose |
|
| 79 |
+
|:---|:---|
|
| 80 |
+
| **License allowlist** | MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, CC0-1.0, EPL-1.0, MPL-2.0, Unlicense, AGPL-3.0, LGPL-2.1, Artistic-2.0 |
|
| 81 |
+
| **Language allowlist** | Python, Java, JavaScript, C, C#, C++, TypeScript, Go, Ruby |
|
| 82 |
+
| **Message length** | 10 < length < 15,000 characters |
|
| 83 |
+
| **Message blocklist** | ~50 low-signal messages excluded (e.g., "initial commit", "wip", "yolo") |
|
| 84 |
+
| **Pattern exclusion** | Merge commits and CI push messages filtered out |
|
| 85 |
+
| **Same-path constraint** | `old_path = new_path` — file was modified in place, not renamed or moved |
|
| 86 |
+
| **Single-file constraint** | Commit touches exactly one file |
|
| 87 |
+
| **Content retrieval** | Both pre-commit and post-commit file contents successfully fetched |
|
| 88 |
+
| **Near-deduplication** | MinHash LSH with Jaccard threshold 0.7 |
|
| 89 |
+
|
| 90 |
+
</div>
|
| 91 |
+
|
| 92 |
+
## Usage
|
| 93 |
+
|
| 94 |
+
```python
|
| 95 |
+
from datasets import load_dataset
|
| 96 |
+
|
| 97 |
+
dataset = load_dataset("project-themis/Themis-Git-Commits")
|
| 98 |
+
|
| 99 |
+
# Inspect a sample
|
| 100 |
+
sample = dataset["train"][0]
|
| 101 |
+
print(f"Commit: {sample['commit']}")
|
| 102 |
+
print(f"Subject: {sample['subject']}")
|
| 103 |
+
print(f"License: {sample['license']}")
|
| 104 |
+
print(f"File: {sample['file_path']}")
|
| 105 |
+
print(f"Old contents length: {len(sample['old_contents'])}")
|
| 106 |
+
print(f"New contents length: {len(sample['new_contents'])}")
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
## License
|
| 110 |
+
|
| 111 |
+
This dataset is released under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). The source commits are drawn exclusively from repositories with permissive open-source licenses (see filter table above).
|
| 112 |
+
|
| 113 |
+
## Citation
|
| 114 |
+
|
| 115 |
+
```bibtex
|
| 116 |
+
@article{themis2025,
|
| 117 |
+
title={Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring},
|
| 118 |
+
author={Paul, Indraneil and Gurevych, Iryna and Glava\v{s}, Goran},
|
| 119 |
+
journal={arXiv preprint arXiv:xxxx.xxxxx},
|
| 120 |
+
year={2025}
|
| 121 |
+
}
|
| 122 |
+
```
|