iNeil77 commited on
Commit
39ad25d
·
verified ·
1 Parent(s): a314d7e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +112 -2
README.md CHANGED
@@ -729,6 +729,116 @@ language:
729
  tags:
730
  - code
731
  - multilingual
 
 
732
  size_categories:
733
- - 1M<n<10M
734
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
  tags:
730
  - code
731
  - multilingual
732
+ - github
733
+ - commits
734
  size_categories:
735
+ - 10M<n<100M
736
+ ---
737
+
738
+ <div align="center">
739
+
740
+ # Themis-Git-Commits
741
+
742
+ [![arXiv](https://img.shields.io/badge/arXiv-xxxx.xxxxx-b31b1b.svg)](https://arxiv.org/abs/xxxx.xxxxx)
743
+ [![Models](https://img.shields.io/badge/%F0%9F%A4%97%20Models-Themis--RM-yellow)](https://huggingface.co/collections/project-themis/themis-reward-model-collection)
744
+ [![Datasets & Benchmarks](https://img.shields.io/badge/%F0%9F%A4%97%20Datasets%20%26%20Benchmarks-Themis-blue)](https://huggingface.co/collections/project-themis/themis-preference-datasets-and-benchmarks)
745
+ [![GitHub](https://img.shields.io/badge/GitHub-Themis-181717?logo=github)](https://github.com/iNeil77/Themis)
746
+
747
+ </div>
748
+
749
+ ## Overview
750
+
751
+ **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.
752
+
753
+ 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.
754
+
755
+ ## Collection Pipeline
756
+
757
+ 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:
758
+
759
+ 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.
760
+
761
+ 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).
762
+
763
+ 3. **Extension Filtering** — Commits are further filtered so the changed file's extension matches a target programming language.
764
+
765
+ 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).
766
+
767
+ 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).
768
+
769
+ ## Downstream Processing (Not in This Dataset)
770
+
771
+ The steps below are applied downstream to produce the final preference pairs in Themis-CodePreference, and are **not** reflected in this raw dataset:
772
+
773
+ - **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.
774
+ - **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).
775
+ - **LLM Scoring & Instruction Synthesis** — Frontier LMs validate preference strength and generate realistic inverse instructions.
776
+ - **LLM-as-a-Judge Preference Labelling** — Multi-sample voting with frontier LMs produces consensus preference labels.
777
+
778
+ ## Dataset Schema
779
+
780
+ <div align="center">
781
+
782
+ | Column | Type | Description |
783
+ |:---|:---:|:---|
784
+ | `commit` | string | Git commit SHA |
785
+ | `subject` | string | First line of the commit message |
786
+ | `message` | string | Full commit message body |
787
+ | `repos` | string | Comma-separated list of repository names containing this commit |
788
+ | `file_path` | string | Path of the changed file |
789
+ | `license` | string | SPDX license identifier of the source repository |
790
+ | `unix_time` | int64 | Committer timestamp (seconds since epoch) |
791
+ | `new_contents` | string | File contents after the commit (post-commit) |
792
+ | `old_contents` | string | File contents before the commit (pre-commit) |
793
+
794
+ </div>
795
+
796
+ ## Filters Applied During Mining
797
+
798
+ <div align="center">
799
+
800
+ | Filter | Purpose |
801
+ |:---|:---|
802
+ | **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 |
803
+ | **Language allowlist** | Python, Java, JavaScript, C, C#, C++, TypeScript, Go, Ruby |
804
+ | **Message length** | 10 < length < 15,000 characters |
805
+ | **Message blocklist** | ~50 low-signal messages excluded (e.g., "initial commit", "wip", "yolo") |
806
+ | **Pattern exclusion** | Merge commits and CI push messages filtered out |
807
+ | **Same-path constraint** | `old_path = new_path` — file was modified in place, not renamed or moved |
808
+ | **Single-file constraint** | Commit touches exactly one file |
809
+ | **Content retrieval** | Both pre-commit and post-commit file contents successfully fetched |
810
+ | **Near-deduplication** | MinHash LSH with Jaccard threshold 0.7 |
811
+
812
+ </div>
813
+
814
+ ## Usage
815
+
816
+ ```python
817
+ from datasets import load_dataset
818
+
819
+ dataset = load_dataset("project-themis/Themis-Git-Commits")
820
+
821
+ # Inspect a sample
822
+ sample = dataset["train"][0]
823
+ print(f"Commit: {sample['commit']}")
824
+ print(f"Subject: {sample['subject']}")
825
+ print(f"License: {sample['license']}")
826
+ print(f"File: {sample['file_path']}")
827
+ print(f"Old contents length: {len(sample['old_contents'])}")
828
+ print(f"New contents length: {len(sample['new_contents'])}")
829
+ ```
830
+
831
+ ## License
832
+
833
+ 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).
834
+
835
+ ## Citation
836
+
837
+ ```bibtex
838
+ @article{themis2025,
839
+ title={Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring},
840
+ author={Paul, Indraneil and Gurevych, Iryna and Glava\v{s}, Goran},
841
+ journal={arXiv preprint arXiv:xxxx.xxxxx},
842
+ year={2025}
843
+ }
844
+ ```