Datasets:
pretty_name: Repository learning training dataset
tags:
- code-review
- github-data
- contrastive-learning
- fine-tuning
- semantic-indexing
- multi-modal
- jsonl
- faiss-index
- tree-sitter
license: mit
language:
- en
size_categories:
- 10K<n<100K
task_categories:
- text-generation
- text-classification
- text-retrieval
- feature-extraction
source_datasets:
- github-repositories
annotations_creators:
- machine-generated
- expert-reviewed
Repository Learning Training Dataset
This dataset contains training data extracted from GitHub repositories for training context-aware code review models. The dataset supports three primary machine learning tasks: contrastive learning, fine-tuning, and semantic indexing.
Dataset Overview
Purpose: Enable training of AI models that understand repository-specific code review patterns and provide contextual feedback.
Source: GitHub repositories with rich pull request history and review comments.
Dataset Structure
{repository-name}/
βββ contrastive/
β βββ changed_files_001.json # Files changed together (positive pairs)
β βββ changed_files_002.json
β βββ ...
βββ fine_tune/
β βββ pr_reviews_001.jsonl # Instruction-following format
β βββ pr_reviews_002.jsonl
β βββ ...
βββ index/
β βββ functions.json # AST-extracted function metadata
βββ manifest.json # Processing metadata
Data Components
1. Contrastive Learning Data (/contrastive/)
Format: JSON files containing file groupings for contrastive learning.
Purpose: Learn semantic relationships between code files based on change patterns.
Structure:
{
"pr_12345": [
"src/components/Button.tsx",
"src/styles/button.css",
"tests/Button.test.tsx"
],
"pr_12346": [
"src/api/user.py",
"src/models/user.py",
"tests/test_user.py"
]
}
Usage: Files changed together form positive pairs; files from different PRs form negative pairs for contrastive learning.
2. Fine-Tuning Data (/fine_tune/)
Format: JSONL files with instruction-following examples.
Purpose: Adapt language models to repository-specific review patterns and conventions.
Structure:
{
"prompt": "Code diff:\n```diff\n+def calculate_score(user_data):\n+ return sum(user_data.values())\n```\nPrevious comments:\n- alice: Consider input validation\n\nPlease write a code review comment:",
"completion": "Good addition! I'd suggest adding type hints and handling edge cases where user_data might be empty or contain non-numeric values."
}
Features:
- Chronological conversation context
- Multi-turn review discussions
- Repository-specific terminology and patterns
- Code diff context with surrounding discussion
3. Semantic Index Data (/index/)
Format: JSON metadata with function definitions and embeddings.
Purpose: Enable fast semantic search across repository functions and documentation.
Structure (functions.json):
[
{
"file": "src/utils/parser.py",
"name": "parse_diff_hunk",
"start_line": 45,
"end_line": 67,
"code": "def parse_diff_hunk(hunk_text: str) -> DiffHunk:\n # Function implementation...",
}
]
Components:
- AST Extraction: Tree-sitter parsers for different programming languages
Data Generation Pipeline
Data Statistics
| Repository | PRs | Review Comments | Functions | Languages |
|---|---|---|---|---|
| dotnet/xharness | 100 | 50 | 1500 | C# |
| dotnet/runtime | N/A | N/A | N/A | C#, c, c++ |
Usage Examples
If you use this dataset, please refer to https://github.com/kotlarmilos/repository-learning