Datasets:

Formats:
parquet
Languages:
English
ArXiv:
Tags:
code
DOI:
Libraries:
Datasets
pandas
License:
Areyde commited on
Commit
055406a
·
verified ·
1 Parent(s): e0062c9

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +53 -51
README.md CHANGED
@@ -323,17 +323,19 @@ configs:
323
  path: kt/train-*
324
  ---
325
  # LCA (Bug Localization)
326
- This is the data for **Bug Localization** benchmark as part of LCA.
 
 
327
  The bug localization problem can be formulated as follows: given an issue with a bug description and a repository snapshot in a state where the bug is reproducible, identify the files within the repository that need to be modified to address the reported bug.
328
 
329
- The dataset provides all required components for evaluation of bug localization approaches in real project-level large-scale data collected from GitHub, including:
330
- * Bug issue description
331
- * Repositories from which the content on the state of the commit SHA where the bug is reproducible can be extracted
332
- * List of files that should be changed in order to solve the bug
333
- * Other additional data and metrics, that can be useful in approach development
334
 
335
- The collected dataset was carefully filtered, enhances with useful metrics and, what is more, manually labeled, which assures the data quality and provides a golden subset of good examples for evaluation.\
336
- Moreover, the dataset was splitted into several categories, naming:
337
 
338
  | **Category** | **Description** | **Number of data points** |
339
  |:------------------:|:----------------------------------------:|:----------------------------------------:|
@@ -341,16 +343,16 @@ Moreover, the dataset was splitted into several categories, naming:
341
  | `java` | Only `.java` files in changes | 2,522 |
342
  | `kt` | Only `.kt` files in changes | 618 |
343
 
344
- And splits, naming:
345
  | **Split** | **Description** |
346
  |:------------------:|:----------------------------------------:|
347
- | `dev` | All collected data point |
348
- | `test` | Manually verified data point |
349
- | `train` | Rest data point from `dev` except `test` |
350
 
351
- The results of evaluation of various bug localization approaches can be found in [Long Code Arena 🏟 leaderboard](https://huggingface.co/spaces/JetBrains-Research/long-code-arena).
352
 
353
- The following sections will describe the utilities around the dataset as well as detailed dataset content description.
354
 
355
  ## How-to
356
 
@@ -367,7 +369,7 @@ The following sections will describe the utilities around the dataset as well as
367
  dataset = load_dataset("JetBrains-Research/lca-bug-localization", configuration, split=split)
368
  ```
369
 
370
- * 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)
371
  ```py
372
  from huggingface_hub import hf_hub_download
373
  from datasets import load_dataset
@@ -399,65 +401,65 @@ The following sections will describe the utilities around the dataset as well as
399
  os.remove(local_repo_zip_path)
400
  ```
401
 
402
- * Data streaming by [HFDataSource](https://github.com/JetBrains-Research/lca-baselines/blob/main/bug_localization/src/baselines/data_sources/hf_data_source.py) \
403
- Besides data loading, `HFDataSource` returns data point for running baseline along with the content of the repository in the state the bug is reproducible (aka `base_sha` commit of the pull request which resloves the bug issue). \
404
- All source code for working with the GitHub history of repositories (commits, diffs, etc.) are available in [`git_utils.py`](https://github.com/JetBrains-Research/lca-baselines/blob/main/bug_localization/src/utils/git_utils.py) as so as example of baselines, utilizes this dataset.
405
 
406
  ### Bug localization data
407
 
408
- Each data point contains main subset of field as well as additional metrics calculated upon them. \
409
  The main fields are:
410
 
411
  | **Field** | **Description** |
412
  |:------------------:|:----------------------------------------:|
413
- | `repo_owner` | Bug issue repository owner. |
414
- | `repo_name` | Bug issue repository name. |
415
- | `issue_url` | GitHub link to issue <br> `https://github.com/{repo_owner}/{repo_name}/issues/{issue_id}`. |
416
- | `pull_url` | GitHub link to pull request <br> `https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}`. |
417
- | `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}`. |
418
  | `issue_title` | Issue title. |
419
  | `issue_body` | Issue body. |
420
- | `base_sha` | Pull request base SHA. |
421
- | `head_sha` | Pull request head SHA. |
422
- | `diff_url` | Pull request diff link between base and head SHA <br> `https://github.com/{repo_owner}/{repo_name}/compare/{base_sha}...{head_sha}`. |
423
- | `diff` | Pull request diff content. |
424
- | `pull_create_at` | Data of pull request creation in format yyyy-mm-ddThh:mm:ssZ. |
425
- | `repo_stars` | Number of repo stars. |
426
- | `changed_files`* | List of changed files parsed from diff. |
427
  | `repo_language` | Main programming language used in the repository. |
428
  | `repo_languages` | All programming languages used in the repository. |
429
- | `repo_license` | Licenses assigned to the repository. |
430
 
431
- \* Excluding test files that do not contain bug causes, rather changed in order to add test for proving that bug is gone.
432
 
433
  The metrics-related fields are:
434
  | **Field** | **Description** |
435
  |:------------------:|:----------------------------------------:|
436
- | `changed_files_exts` | Dict from changed files extension to count. |
437
  | `changed_files_count` | Number of changed files. |
438
  | `java_changed_files_count` | Number of changed `.java` files. |
439
  | `kt_changed_files_count` | Number of changed `.kt` files. |
440
  | `py_changed_files_count` | Number of changed `.py` files. |
441
- | `code_changed_files_count` | Number of changed `.java`, `.kt` or `.py` files. |
442
- | `repo_symbols_count`* | Number of symbols in repository. |
443
- | `repo_tokens_count`* | Number of tokens** in files in repository. |
444
- | `repo_lines_count`* | Number of lines in files in repository. |
445
- | `repo_files_without_tests_count`* | Number of files in repository. |
446
- | `changed_symbols_count`* | Number of symbols in changed lines in diff. |
447
- | `changed_tokens_count`* | Number of tokens** in changed lines in diff. |
448
  | `changed_lines_count`* | Number of changed lines in diff (including added and deleted). |
449
  | `changed_files_without_tests_count`* | Number of files in diff. |
450
- | `issue_symbols_count`* | Number of symbols in issue body. |
451
- | `issue_words_count`* | Number of words in issue body (separated by space symbols). |
452
- | `issue_tokens_count`* | Number of tokens** in issue body. |
453
- | `issue_lines_count`* | Number of text lines in issue body (separated by \\n). |
454
- | `issue_links_count` | Number of links (\[...\](...)) presented in issue body. |
455
- | `issue_code_blocks_count` | Number of code blocks (\`\`\`...\`\`\`) presented in issue body. |
456
 
457
- \* Excluding test files that do not contain bug causes, rather changed in order to add test for proving that bug is gone. \
458
  \*\* Using GPT-4 tokenizer via ticktoken.
459
 
460
  ### Repositories data
461
- The compressed repositories provided in section [repos](https://huggingface.co/datasets/JetBrains-Research/lca-bug-localization/tree/main/repos) separately from data point to provide access to the various stages of repository, saving its initial structure, as well as to reuse one's content for different data point connected to the same repository.
462
- To extract the required information from repositories, each zip file should be unarchived. Afterwords, we recommend to use [GitPython](https://github.com/gitpython-developers/GitPython) or [PyDriller](https://github.com/ishepard/pydriller) python library to navigate thought repository history and extract one's content on required commit or calculate diff.
463
- Most of the required utility methods are provided in our repository in [`git_utils.py`](https://github.com/JetBrains-Research/lca-baselines/blob/main/bug_localization/src/utils/git_utils.py), so you may reuse them to access required repository data.
 
323
  path: kt/train-*
324
  ---
325
  # LCA (Bug Localization)
326
+ This is the benchmark for the Bug localization task as part of the
327
+ 🏟️ [Long Code Arena benchmark](https://huggingface.co/spaces/JetBrains-Research/long-code-arena).
328
+
329
  The bug localization problem can be formulated as follows: given an issue with a bug description and a repository snapshot in a state where the bug is reproducible, identify the files within the repository that need to be modified to address the reported bug.
330
 
331
+ The dataset provides all the required components for evaluation of bug localization approaches in real project-level large-scale data collected from GitHub, including:
332
+ * Bug issue description;
333
+ * Repositories, from which the content can be extracted at the state of the commit SHA where the bug is reproducible;
334
+ * List of files that should be changed in order to solve the bug;
335
+ * Other additional data and metrics that can be useful in developing new approaches.
336
 
337
+ The collected dataset was carefully filtered, enhanced with useful metrics and, what's more, manually labeled, which assures the data quality and provides a golden subset of good examples for evaluation.\
338
+ Moreover, the dataset was split into several categories, namely:
339
 
340
  | **Category** | **Description** | **Number of data points** |
341
  |:------------------:|:----------------------------------------:|:----------------------------------------:|
 
343
  | `java` | Only `.java` files in changes | 2,522 |
344
  | `kt` | Only `.kt` files in changes | 618 |
345
 
346
+ ...and splits, namely:
347
  | **Split** | **Description** |
348
  |:------------------:|:----------------------------------------:|
349
+ | `dev` | All collected datapoints |
350
+ | `test` | Manually verified datapoints |
351
+ | `train` | Rest of the datapoint from `dev` without `test` |
352
 
353
+ The results of evaluation of various bug localization approaches can be found in the [Long Code Arena 🏟 leaderboard](https://huggingface.co/spaces/JetBrains-Research/long-code-arena).
354
 
355
+ The following sections describe the utilities around the dataset, as well as dataset content.
356
 
357
  ## How-to
358
 
 
369
  dataset = load_dataset("JetBrains-Research/lca-bug-localization", configuration, split=split)
370
  ```
371
 
372
+ * 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):
373
  ```py
374
  from huggingface_hub import hf_hub_download
375
  from datasets import load_dataset
 
401
  os.remove(local_repo_zip_path)
402
  ```
403
 
404
+ * Data streaming via [HFDataSource](https://github.com/JetBrains-Research/lca-baselines/blob/main/bug_localization/src/baselines/data_sources/hf_data_source.py).
405
+ Besides data loading, `HFDataSource` returns a datapoint for running the baseline along with the content of the repository at the state where the bug is reproducible (aka `base_sha` commit of the pull request that resloves the bug issue). \
406
+ All source code for working with the Git history of repositories (commits, diffs, etc.) is available in [`git_utils.py`](https://github.com/JetBrains-Research/lca-baselines/blob/main/bug_localization/src/utils/git_utils.py), as is an example of baselines, utilizing this dataset.
407
 
408
  ### Bug localization data
409
 
410
+ Each datapoint contains the main fields, as well as additional metrics calculated on them. \
411
  The main fields are:
412
 
413
  | **Field** | **Description** |
414
  |:------------------:|:----------------------------------------:|
415
+ | `repo_owner` | Owner of the repository with the bug issue. |
416
+ | `repo_name` | Name of the repository with the bug issue. |
417
+ | `issue_url` | GitHub link to the issue <br> `https://github.com/{repo_owner}/{repo_name}/issues/{issue_id}`. |
418
+ | `pull_url` | GitHub link to the pull request <br> `https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}`. |
419
+ | `comment_url` | GitHub link to the comment with a reference from pull request to issue <br> `https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}#issuecomment-{comment_id}`. |
420
  | `issue_title` | Issue title. |
421
  | `issue_body` | Issue body. |
422
+ | `base_sha` | Base SHA of the pull request. |
423
+ | `head_sha` | Head SHA of the pull request. |
424
+ | `diff_url` | Link to the diff between the base and the head SHA <br> `https://github.com/{repo_owner}/{repo_name}/compare/{base_sha}...{head_sha}`. |
425
+ | `diff` | Content of the diff. |
426
+ | `pull_create_at` | Date of pull request creation in the `yyyy-mm-ddThh:mm:ssZ` format. |
427
+ | `repo_stars` | Number of stars of the repo. |
428
+ | `changed_files`* | List of the changed files parsed from diff. |
429
  | `repo_language` | Main programming language used in the repository. |
430
  | `repo_languages` | All programming languages used in the repository. |
431
+ | `repo_license` | License assigned to the repository. |
432
 
433
+ \* Excluding test files that do not contain bug causes, rather changed in order to add tests for proving that the bug is gone.
434
 
435
  The metrics-related fields are:
436
  | **Field** | **Description** |
437
  |:------------------:|:----------------------------------------:|
438
+ | `changed_files_exts` | Dictionary from the extension of changed files to their count. |
439
  | `changed_files_count` | Number of changed files. |
440
  | `java_changed_files_count` | Number of changed `.java` files. |
441
  | `kt_changed_files_count` | Number of changed `.kt` files. |
442
  | `py_changed_files_count` | Number of changed `.py` files. |
443
+ | `code_changed_files_count` | Number of changed `.java`, `.kt`, or `.py` files. |
444
+ | `repo_symbols_count`* | Number of symbols in the repository. |
445
+ | `repo_tokens_count`* | Number of tokens** in the files of the repository. |
446
+ | `repo_lines_count`* | Number of lines in the files of the repository. |
447
+ | `repo_files_without_tests_count`* | Number of files in the repository. |
448
+ | `changed_symbols_count`* | Number of symbols in the changed lines in diff. |
449
+ | `changed_tokens_count`* | Number of tokens** in the changed lines in diff. |
450
  | `changed_lines_count`* | Number of changed lines in diff (including added and deleted). |
451
  | `changed_files_without_tests_count`* | Number of files in diff. |
452
+ | `issue_symbols_count`* | Number of symbols in the issue body. |
453
+ | `issue_words_count`* | Number of words in the issue body (separated by space symbols). |
454
+ | `issue_tokens_count`* | Number of tokens** in the issue body. |
455
+ | `issue_lines_count`* | Number of text lines in the issue body (separated by `\\n`). |
456
+ | `issue_links_count` | Number of links (\[...\](...)) present in the issue body. |
457
+ | `issue_code_blocks_count` | Number of code blocks (\`\`\`...\`\`\`) present in the issue body. |
458
 
459
+ \* Excluding test files that do not contain bug causes, rather changed in order to add tests for proving that the bug is gone. \
460
  \*\* Using GPT-4 tokenizer via ticktoken.
461
 
462
  ### Repositories data
463
+ The compressed repositories are provided in the [repos](https://huggingface.co/datasets/JetBrains-Research/lca-bug-localization/tree/main/repos) section, separately from datapoints, to provide access to the various stages of repositories, saving their initial structure, as well as to reuse their content for different datapoints connected to the same repository.
464
+ To extract the required information from repositories, each `zip` file should be unarchived. Afterwords, we recommend to use [GitPython](https://github.com/gitpython-developers/GitPython) or [PyDriller](https://github.com/ishepard/pydriller) Python libraries to navigate through the repository history and extract its content on the required commit or calculate diff.
465
+ Most of the required utility methods are provided in our repository in the [`git_utils.py`](https://github.com/JetBrains-Research/lca-baselines/blob/main/bug_localization/src/utils/git_utils.py) file, so you may reuse them to access the required repository data.