Update README.md
Browse files
README.md
CHANGED
|
@@ -47,13 +47,14 @@ dataset_info:
|
|
| 47 |
dataset_size: 1500130634
|
| 48 |
task_categories:
|
| 49 |
- text-generation
|
|
|
|
| 50 |
language:
|
| 51 |
- en
|
| 52 |
tags:
|
| 53 |
- code
|
| 54 |
pretty_name: Github issues dataset
|
| 55 |
size_categories:
|
| 56 |
-
-
|
| 57 |
---
|
| 58 |
|
| 59 |
# GitHub Pull Request Bug–Fix Dataset
|
|
@@ -72,63 +73,104 @@ This dataset is designed for:
|
|
| 72 |
|
| 73 |
---
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
## Data collection methodology
|
| 76 |
|
| 77 |
-
Data was collected
|
|
|
|
| 78 |
|
| 79 |
-
|
| 80 |
|
| 81 |
-
- Only **
|
| 82 |
-
- Each
|
| 83 |
-
-
|
| 84 |
-
- Code changes are stored as **unified diffs
|
| 85 |
-
-
|
| 86 |
-
-
|
| 87 |
|
| 88 |
-
Each dataset row represents **one bug–fix
|
| 89 |
|
| 90 |
---
|
| 91 |
|
| 92 |
## Dataset schema
|
| 93 |
|
| 94 |
-
Each entry follows the schema below:
|
| 95 |
|
| 96 |
```json
|
| 97 |
{
|
| 98 |
"repo": "owner/repository",
|
| 99 |
-
"pr_number": 12345,
|
| 100 |
-
"title": "Short description of the fix",
|
| 101 |
-
"body": "Pull request description and context",
|
| 102 |
"buggy_commit": "abcdef123456...",
|
| 103 |
"fix_commit": "fedcba654321...",
|
| 104 |
-
"
|
| 105 |
-
"
|
| 106 |
"files": [
|
| 107 |
{
|
| 108 |
-
"
|
| 109 |
"patch": "unified diff representing the fix",
|
| 110 |
"additions": 10,
|
| 111 |
-
"deletions": 2
|
|
|
|
| 112 |
}
|
| 113 |
]
|
| 114 |
}
|
| 115 |
```
|
| 116 |
|
| 117 |
-
| Field | Description
|
| 118 |
-
| ------------------- | ------------------------------------------------- |
|
| 119 |
-
| `repo` | GitHub repository containing the
|
| 120 |
-
| `
|
| 121 |
-
| `
|
| 122 |
-
| `
|
| 123 |
-
| `
|
| 124 |
-
| `
|
| 125 |
-
| `
|
| 126 |
-
| `
|
| 127 |
-
| `files`
|
| 128 |
-
| `files[].
|
| 129 |
-
| `files[].
|
| 130 |
-
|
| 131 |
-
| `files[].deletions` | Number of lines removed |
|
| 132 |
|
| 133 |
## Supported languages
|
| 134 |
|
|
@@ -165,6 +207,15 @@ Buggy commit identification is heuristic and may be imperfect
|
|
| 165 |
Some fixes involve refactoring or design changes rather than minimal patches
|
| 166 |
No guarantee that fixes represent optimal or best-practice solutions
|
| 167 |
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
dataset_size: 1500130634
|
| 48 |
task_categories:
|
| 49 |
- text-generation
|
| 50 |
+
- summarization
|
| 51 |
language:
|
| 52 |
- en
|
| 53 |
tags:
|
| 54 |
- code
|
| 55 |
pretty_name: Github issues dataset
|
| 56 |
size_categories:
|
| 57 |
+
- 100K<n<1M
|
| 58 |
---
|
| 59 |
|
| 60 |
# GitHub Pull Request Bug–Fix Dataset
|
|
|
|
| 73 |
|
| 74 |
---
|
| 75 |
|
| 76 |
+
## How to use
|
| 77 |
+
|
| 78 |
+
install datasets python library:
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
pip install datasets
|
| 82 |
+
```
|
| 83 |
+
here is a copy paste example
|
| 84 |
+
```python
|
| 85 |
+
from datasets import load_dataset
|
| 86 |
+
|
| 87 |
+
# Load all splits
|
| 88 |
+
dataset = load_dataset("helloadhavan/github_issues")
|
| 89 |
+
|
| 90 |
+
print(dataset)
|
| 91 |
+
# pick the train split
|
| 92 |
+
|
| 93 |
+
example = dataset["train"][0]
|
| 94 |
+
|
| 95 |
+
# Inspect a single example
|
| 96 |
+
|
| 97 |
+
print("Repository:", example["repo"])
|
| 98 |
+
print("Buggy commit:", example["buggy_commit"])
|
| 99 |
+
print("Fix commit:", example["fix_commit"])
|
| 100 |
+
print("Message:", example["message"])
|
| 101 |
+
print("Timestamp:", example["timestamp"])
|
| 102 |
+
|
| 103 |
+
print("\nModified files:")
|
| 104 |
+
for f in example["files"]:
|
| 105 |
+
print("-", f["path"], f["language"])
|
| 106 |
+
|
| 107 |
+
# Filter examples by programming language
|
| 108 |
+
|
| 109 |
+
def contains_assembly_file(example):
|
| 110 |
+
return any(f["language"] == "Assembly" for f in example["files"])
|
| 111 |
+
|
| 112 |
+
python_fixes = dataset["train"].filter(contains_assembly_file)
|
| 113 |
+
|
| 114 |
+
print("Assembly-related fixes:", len(python_fixes))
|
| 115 |
+
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
|
| 119 |
## Data collection methodology
|
| 120 |
|
| 121 |
+
Data was collected from **GitHub repositories** by identifying commit pairs that represent
|
| 122 |
+
a **bug-introducing version** and its corresponding **fix commit**.
|
| 123 |
|
| 124 |
+
The dataset was constructed and post-processed to ensure high signal and usability:
|
| 125 |
|
| 126 |
+
- Only commits representing **bug fixes or correctness changes** were included
|
| 127 |
+
- Each example explicitly links a **buggy commit** to the corresponding **fix commit**
|
| 128 |
+
- Repository metadata is preserved for traceability
|
| 129 |
+
- Code changes are stored as **unified diffs at the file level**
|
| 130 |
+
- Commits that only perform refactoring, formatting, or non-functional changes were excluded
|
| 131 |
+
- Entries without meaningful code changes were filtered out
|
| 132 |
|
| 133 |
+
Each dataset row represents **one bug–fix commit pair**, rather than a pull request.
|
| 134 |
|
| 135 |
---
|
| 136 |
|
| 137 |
## Dataset schema
|
| 138 |
|
| 139 |
+
Each entry in the dataset follows the schema below:
|
| 140 |
|
| 141 |
```json
|
| 142 |
{
|
| 143 |
"repo": "owner/repository",
|
|
|
|
|
|
|
|
|
|
| 144 |
"buggy_commit": "abcdef123456...",
|
| 145 |
"fix_commit": "fedcba654321...",
|
| 146 |
+
"message": "Commit message describing the fix",
|
| 147 |
+
"timestamp": "YYYY-MM-DDTHH:MM:SSZ",
|
| 148 |
"files": [
|
| 149 |
{
|
| 150 |
+
"path": "path/to/file.ext",
|
| 151 |
"patch": "unified diff representing the fix",
|
| 152 |
"additions": 10,
|
| 153 |
+
"deletions": 2,
|
| 154 |
+
"language": "Programming language inferred from file extension"
|
| 155 |
}
|
| 156 |
]
|
| 157 |
}
|
| 158 |
```
|
| 159 |
|
| 160 |
+
| Field | Description |
|
| 161 |
+
| ------------------- | ----------------------------------------------------- |
|
| 162 |
+
| `repo` | GitHub repository containing the fix |
|
| 163 |
+
| `buggy_commit` | Commit introducing or containing the bug |
|
| 164 |
+
| `fix_commit` | Commit that fixes the bug |
|
| 165 |
+
| `message` | Commit message associated with the fix |
|
| 166 |
+
| `timestamp` | Timestamp of the fix commit (ISO 8601 format) |
|
| 167 |
+
| `files` | List of files modified by the fix |
|
| 168 |
+
| `files[].path` | Path to the modified file |
|
| 169 |
+
| `files[].patch` | Unified diff containing the code changes |
|
| 170 |
+
| `files[].additions` | Number of lines added |
|
| 171 |
+
| `files[].deletions` | Number of lines removed |
|
| 172 |
+
| `files[].language` | Programming language inferred from the file extension |
|
| 173 |
+
|
|
|
|
| 174 |
|
| 175 |
## Supported languages
|
| 176 |
|
|
|
|
| 207 |
Some fixes involve refactoring or design changes rather than minimal patches
|
| 208 |
No guarantee that fixes represent optimal or best-practice solutions
|
| 209 |
|
| 210 |
+
<blockquote
|
| 211 |
+
style="
|
| 212 |
+
background: #fff7cc;
|
| 213 |
+
border-left: 5px solid #ffad00;
|
| 214 |
+
padding: 12px 16px;
|
| 215 |
+
color: #5c4b00;
|
| 216 |
+
font-style: italic;
|
| 217 |
+
border-radius: 4px;
|
| 218 |
+
"
|
| 219 |
+
>
|
| 220 |
+
<strong style="color:rgba(57, 0, 0, 1)">Note:</strong> Due to a bug in the scraper code, 109k samples were collected instead of the planned 50k.
|
| 221 |
+
</blockquote>
|