bug-localization / README.md
tiginamaria's picture
Upload dataset
3181fcc verified
|
raw
history blame
12.9 kB
metadata
license: other
dataset_info:
  - config_name: java
    features:
      - name: id
        dtype: int64
      - name: text_id
        dtype: string
      - name: repo_owner
        dtype: string
      - name: repo_name
        dtype: string
      - name: issue_url
        dtype: string
      - name: pull_url
        dtype: string
      - name: comment_url
        dtype: string
      - name: links_count
        dtype: int64
      - name: link_keyword
        dtype: string
      - name: issue_title
        dtype: string
      - name: issue_body
        dtype: string
      - name: base_sha
        dtype: string
      - name: head_sha
        dtype: string
      - name: diff_url
        dtype: string
      - name: diff
        dtype: string
      - name: changed_files
        dtype: string
      - name: changed_files_exts
        dtype: string
      - name: changed_files_count
        dtype: int64
      - name: java_changed_files_count
        dtype: int64
      - name: kt_changed_files_count
        dtype: int64
      - name: py_changed_files_count
        dtype: int64
      - name: code_changed_files_count
        dtype: int64
      - name: repo_symbols_count
        dtype: int64
      - name: repo_tokens_count
        dtype: int64
      - name: repo_lines_count
        dtype: int64
      - name: repo_files_without_tests_count
        dtype: int64
      - name: changed_symbols_count
        dtype: int64
      - name: changed_tokens_count
        dtype: int64
      - name: changed_lines_count
        dtype: int64
      - name: changed_files_without_tests_count
        dtype: int64
      - name: issue_symbols_count
        dtype: int64
      - name: issue_words_count
        dtype: int64
      - name: issue_tokens_count
        dtype: int64
      - name: issue_lines_count
        dtype: int64
      - name: issue_links_count
        dtype: int64
      - name: issue_code_blocks_count
        dtype: int64
      - name: pull_create_at
        dtype: timestamp[s]
      - name: stars
        dtype: int64
      - name: language
        dtype: string
      - name: languages
        dtype: string
      - name: license
        dtype: string
    splits:
      - name: dev
        num_bytes: 22190207
        num_examples: 2522
      - name: test
        num_bytes: 351946.1855670103
        num_examples: 40
      - name: train
        num_bytes: 21838260.81443299
        num_examples: 2482
    download_size: 21616168
    dataset_size: 44380414
  - config_name: kt
    features:
      - name: id
        dtype: int64
      - name: text_id
        dtype: string
      - name: repo_owner
        dtype: string
      - name: repo_name
        dtype: string
      - name: issue_url
        dtype: string
      - name: pull_url
        dtype: string
      - name: comment_url
        dtype: string
      - name: links_count
        dtype: int64
      - name: link_keyword
        dtype: string
      - name: issue_title
        dtype: string
      - name: issue_body
        dtype: string
      - name: base_sha
        dtype: string
      - name: head_sha
        dtype: string
      - name: diff_url
        dtype: string
      - name: diff
        dtype: string
      - name: changed_files
        dtype: string
      - name: changed_files_exts
        dtype: string
      - name: changed_files_count
        dtype: int64
      - name: java_changed_files_count
        dtype: int64
      - name: kt_changed_files_count
        dtype: int64
      - name: py_changed_files_count
        dtype: int64
      - name: code_changed_files_count
        dtype: int64
      - name: repo_symbols_count
        dtype: int64
      - name: repo_tokens_count
        dtype: int64
      - name: repo_lines_count
        dtype: int64
      - name: repo_files_without_tests_count
        dtype: int64
      - name: changed_symbols_count
        dtype: int64
      - name: changed_tokens_count
        dtype: int64
      - name: changed_lines_count
        dtype: int64
      - name: changed_files_without_tests_count
        dtype: int64
      - name: issue_symbols_count
        dtype: int64
      - name: issue_words_count
        dtype: int64
      - name: issue_tokens_count
        dtype: int64
      - name: issue_lines_count
        dtype: int64
      - name: issue_links_count
        dtype: int64
      - name: issue_code_blocks_count
        dtype: int64
      - name: pull_create_at
        dtype: timestamp[s]
      - name: stars
        dtype: int64
      - name: language
        dtype: string
      - name: languages
        dtype: string
      - name: license
        dtype: string
    splits:
      - name: dev
        num_bytes: 4867349
        num_examples: 618
      - name: test
        num_bytes: 110263.56957928803
        num_examples: 14
      - name: train
        num_bytes: 4757085.430420712
        num_examples: 604
    download_size: 5048158
    dataset_size: 9734698
  - config_name: mixed
    features:
      - name: id
        dtype: int64
      - name: text_id
        dtype: string
      - name: repo_owner
        dtype: string
      - name: repo_name
        dtype: string
      - name: issue_url
        dtype: string
      - name: pull_url
        dtype: string
      - name: comment_url
        dtype: string
      - name: links_count
        dtype: int64
      - name: link_keyword
        dtype: string
      - name: issue_title
        dtype: string
      - name: issue_body
        dtype: string
      - name: base_sha
        dtype: string
      - name: head_sha
        dtype: string
      - name: diff_url
        dtype: string
      - name: diff
        dtype: string
      - name: changed_files
        dtype: string
      - name: changed_files_exts
        dtype: string
      - name: changed_files_count
        dtype: int64
      - name: java_changed_files_count
        dtype: int64
      - name: kt_changed_files_count
        dtype: int64
      - name: py_changed_files_count
        dtype: int64
      - name: code_changed_files_count
        dtype: int64
      - name: repo_symbols_count
        dtype: int64
      - name: repo_tokens_count
        dtype: int64
      - name: repo_lines_count
        dtype: int64
      - name: repo_files_without_tests_count
        dtype: int64
      - name: changed_symbols_count
        dtype: int64
      - name: changed_tokens_count
        dtype: int64
      - name: changed_lines_count
        dtype: int64
      - name: changed_files_without_tests_count
        dtype: int64
      - name: issue_symbols_count
        dtype: int64
      - name: issue_words_count
        dtype: int64
      - name: issue_tokens_count
        dtype: int64
      - name: issue_lines_count
        dtype: int64
      - name: issue_links_count
        dtype: int64
      - name: issue_code_blocks_count
        dtype: int64
      - name: pull_create_at
        dtype: timestamp[s]
      - name: stars
        dtype: int64
      - name: language
        dtype: string
      - name: languages
        dtype: string
      - name: license
        dtype: string
    splits:
      - name: dev
        num_bytes: 48686593
        num_examples: 2322
      - name: test
        num_bytes: 41935.049956933675
        num_examples: 2
      - name: train
        num_bytes: 48644657.95004307
        num_examples: 2320
    download_size: 51850711
    dataset_size: 97373186
  - config_name: py
    features:
      - name: id
        dtype: int64
      - name: text_id
        dtype: string
      - name: repo_owner
        dtype: string
      - name: repo_name
        dtype: string
      - name: issue_url
        dtype: string
      - name: pull_url
        dtype: string
      - name: comment_url
        dtype: string
      - name: links_count
        dtype: int64
      - name: link_keyword
        dtype: string
      - name: issue_title
        dtype: string
      - name: issue_body
        dtype: string
      - name: base_sha
        dtype: string
      - name: head_sha
        dtype: string
      - name: diff_url
        dtype: string
      - name: diff
        dtype: string
      - name: changed_files
        dtype: string
      - name: changed_files_exts
        dtype: string
      - name: changed_files_count
        dtype: int64
      - name: java_changed_files_count
        dtype: int64
      - name: kt_changed_files_count
        dtype: int64
      - name: py_changed_files_count
        dtype: int64
      - name: code_changed_files_count
        dtype: int64
      - name: repo_symbols_count
        dtype: int64
      - name: repo_tokens_count
        dtype: int64
      - name: repo_lines_count
        dtype: int64
      - name: repo_files_without_tests_count
        dtype: int64
      - name: changed_symbols_count
        dtype: int64
      - name: changed_tokens_count
        dtype: int64
      - name: changed_lines_count
        dtype: int64
      - name: changed_files_without_tests_count
        dtype: int64
      - name: issue_symbols_count
        dtype: int64
      - name: issue_words_count
        dtype: int64
      - name: issue_tokens_count
        dtype: int64
      - name: issue_lines_count
        dtype: int64
      - name: issue_links_count
        dtype: int64
      - name: issue_code_blocks_count
        dtype: int64
      - name: pull_create_at
        dtype: timestamp[s]
      - name: stars
        dtype: int64
      - name: language
        dtype: string
      - name: languages
        dtype: string
      - name: license
        dtype: string
    splits:
      - name: train
        num_bytes: 26642300.562341552
        num_examples: 4335
      - name: dev
        num_bytes: 26666884
        num_examples: 4339
      - name: test
        num_bytes: 307292.97073058307
        num_examples: 50
    download_size: 59708962
    dataset_size: 53616477.53307214
configs:
  - config_name: java
    data_files:
      - split: dev
        path: java/dev-*
      - split: test
        path: java/test-*
      - split: train
        path: java/train-*
  - config_name: kt
    data_files:
      - split: dev
        path: kt/dev-*
      - split: test
        path: kt/test-*
      - split: train
        path: kt/train-*
  - config_name: mixed
    data_files:
      - split: dev
        path: mixed/dev-*
      - split: test
        path: mixed/test-*
      - split: train
        path: mixed/train-*
  - config_name: py
    data_files:
      - split: dev
        path: py/dev-*
      - split: test
        path: py/test-*
      - split: train
        path: py/train-*

Bug Localization

This is the data for Bug Localization benchmark.

How-to

  1. Since the dataset is private, if you haven't used HF Hub before, add your token via huggingface-cli first:

    huggingface-cli login
    
  2. List all the available configs via datasets.get_dataset_config_names and choose an appropriate one

  3. Load the data via load_dataset:

    from datasets import load_dataset
    
    # Select a configuration from ["py", "java", "kt", "mixed"]
    configuration = "py"
    # Select a split from ["dev", "train", "test"]
    split = "dev"
    # Load data
    dataset = load_dataset("JetBrains-Research/lca-bug-localization", configuration, split=split)  
    
  4. Load repos via hf_hub_download

    from huggingface_hub import hf_hub_download
    from datasets import load_dataset
    
    # Load json with list of repos' .tar.gz file paths
    paths_json = load_dataset("JetBrains-Research/lca-bug-localization", data_files="paths.json")
    
    # Load each repo in .tar.gz format, unzip, delete archive
    repos = paths_json["repos"][0]
    
    for i, repo_tar_path in enumerate(repos):
    
        local_repo_tars = hf_hub_download(
            "JetBrains-Research/lca-bug-localization",
            filename=repo_tar_path,
            repo_type="dataset",
            local_dir="local/dir"
        )
    
        result = subprocess.run(["tar", "-xzf", local_repo_tars, "-C", os.path.join("local/dir", "repos")])
        os.remove(local_repo_tars)
    

Dataset Structure

TODO: some overall structure or repo

Bug localization data

This section concerns configuration with full data about each commit (no -labels suffix).

Each example has the following fields:

Field Description
repo_owner Bug issue repository owner.
repo_name Bug issue repository name.
issue_url GitHub link to issue
https://github.com/{repo_owner}/{repo_name}/issues/{issue_id}.
pull_url GitHub link to pull request
https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}.
comment_url GitHub link to comment with pull request to issue reference
https://github.com/{repo_owner}/{repo_name}/pull/{pull_id}#issuecomment-{comment_id}.
issue_title Issue title.
issue_body Issue body.
base_sha Pull request base sha.
head_sha Pull request head sha.
diff_url Pull request diff url between base and head sha
https://github.com/{repo_owner}/{repo_name}/compare/{base_sha}...{head_sha}.
diff Pull request diff content.
changed_files List of changed files parsed from diff.
changed_files_exts Dict from changed files extension to count.
changed_files_count Number of changed files.
java_changed_files_count Number of changed .java files.
kt_changed_files_count Number of changed .kt files.
py_changed_files_count Number of changed .py files.
code_changed_files_count Number of changed .java, .kt or .py files.
pull_create_at Data of pull request creation in format yyyy-mm-ddThh:mm:ssZ.
stars Number of repo stars.

Repos data

TODO: describe repos data as .tar.gz archives with list of repos metadata