Datasets:
Tasks:
Text Generation
Formats:
parquet
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
code
DOI:
License:
Update README.md
Browse files
README.md
CHANGED
|
@@ -242,15 +242,40 @@ This is the data for **Bug Localization** benchmark as part of LCA.
|
|
| 242 |
|
| 243 |
3. Load the data via [`load_dataset`](https://huggingface.co/docs/datasets/v2.14.3/en/package_reference/loading_methods#datasets.load_dataset):
|
| 244 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 245 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
from datasets import load_dataset
|
| 247 |
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 251 |
|
| 252 |
-
|
| 253 |
-
|
|
|
|
| 254 |
|
| 255 |
## Dataset Structure
|
| 256 |
|
|
@@ -266,23 +291,24 @@ Each example has the following fields:
|
|
| 266 |
|:------------------:|:----------------------------------------:|
|
| 267 |
| `repo_owner` | Bug issue repository owner. |
|
| 268 |
| `repo_name` | Bug issue repository name. |
|
| 269 |
-
|
|
| 270 |
-
|
|
| 271 |
-
|
|
| 272 |
-
|
|
| 273 |
-
|
|
| 274 |
-
|
|
| 275 |
-
|
|
| 276 |
-
|
|
| 277 |
-
|
|
| 278 |
-
|
|
| 279 |
-
|
|
| 280 |
-
|
|
| 281 |
-
|
|
| 282 |
-
|
|
| 283 |
-
|
|
| 284 |
-
|
|
| 285 |
-
|
|
|
|
|
| 286 |
|
| 287 |
### Repos data
|
| 288 |
|
|
|
|
| 242 |
|
| 243 |
3. Load the data via [`load_dataset`](https://huggingface.co/docs/datasets/v2.14.3/en/package_reference/loading_methods#datasets.load_dataset):
|
| 244 |
|
| 245 |
+
```py
|
| 246 |
+
from datasets import load_dataset
|
| 247 |
+
|
| 248 |
+
# Select a configuration from ["py", "java", "kt", "mixed"]
|
| 249 |
+
configuration = "py"
|
| 250 |
+
# Select a split from ["dev", "train", "test"]
|
| 251 |
+
split = "dev"
|
| 252 |
+
# Load data
|
| 253 |
+
dataset = load_dataset("JetBrains-Research/lca-bug-localization", configuration, split=split)
|
| 254 |
```
|
| 255 |
+
|
| 256 |
+
4. Load repos via [`hf_hub_download`](https://huggingface.co/docs/huggingface_hub/v0.20.3/en/package_reference/file_download#huggingface_hub.hf_hub_download)
|
| 257 |
+
```py
|
| 258 |
+
from huggingface_hub import hf_hub_download
|
| 259 |
from datasets import load_dataset
|
| 260 |
|
| 261 |
+
# Load json with list of repos' .tar.gz file paths
|
| 262 |
+
paths_json = load_dataset("JetBrains-Research/lca-bug-localization", data_files="paths.json")
|
| 263 |
+
|
| 264 |
+
# Load each repo in .tar.gz format, unzip, delete archive
|
| 265 |
+
repos = paths_json["repos"][0]
|
| 266 |
+
|
| 267 |
+
for i, repo_tar_path in enumerate(repos):
|
| 268 |
+
|
| 269 |
+
local_repo_tars = hf_hub_download(
|
| 270 |
+
"JetBrains-Research/lca-bug-localization",
|
| 271 |
+
filename=repo_tar_path,
|
| 272 |
+
repo_type="dataset",
|
| 273 |
+
local_dir="local/dir"
|
| 274 |
+
)
|
| 275 |
|
| 276 |
+
result = subprocess.run(["tar", "-xzf", local_repo_tars, "-C", os.path.join("local/dir", "repos")])
|
| 277 |
+
os.remove(local_repo_tars)
|
| 278 |
+
```
|
| 279 |
|
| 280 |
## Dataset Structure
|
| 281 |
|
|
|
|
| 291 |
|:------------------:|:----------------------------------------:|
|
| 292 |
| `repo_owner` | Bug issue repository owner. |
|
| 293 |
| `repo_name` | Bug issue repository name. |
|
| 294 |
+
| `issue_url` | GitHub link to issue <br> `https://github.com/{repo_owner}/{repo_name}/issues/{issue_id}`. |
|
| 295 |
+
| `pull_url` | GitHub link to pull request <br> `https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}`. |
|
| 296 |
+
| `comment_url` | GitHub link to comment with pull request to issue reference <br> `https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}#issuecomment-{comment_id}`. |
|
| 297 |
+
| `issue_title` | Issue title. |
|
| 298 |
+
| `issue_body` | Issue body. |
|
| 299 |
+
| `base_sha` | Pull request base sha. |
|
| 300 |
+
| `head_sha` | Pull request head sha. |
|
| 301 |
+
| `diff_url` | Pull request diff url between base and head sha <br> `https://github.com/{repo_owner}/{repo_name}/compare/{base_sha}...{head_sha}`. |
|
| 302 |
+
| `diff` | Pull request diff content. |
|
| 303 |
+
| `changed_files` | List of changed files parsed from diff. |
|
| 304 |
+
| `changed_files_exts` | Dict from changed files extension to count. |
|
| 305 |
+
| `changed_files_count` | Number of changed files. |
|
| 306 |
+
| `java_changed_files_count` | Number of changed `.java` files. |
|
| 307 |
+
| `kt_changed_files_count` | Number of changed `.kt` files. |
|
| 308 |
+
| `py_changed_files_count` | Number of changed `.py` files. |
|
| 309 |
+
| `code_changed_files_count` | Number of changed `.java`, `.kt` or `.py` files. |
|
| 310 |
+
| `pull_create_at` | Data of pull request creation in format yyyy-mm-ddThh:mm:ssZ. |
|
| 311 |
+
| `stars` | Number of repo stars. |
|
| 312 |
|
| 313 |
### Repos data
|
| 314 |
|