HYUKI5's picture
google/code_x_glue_cc_defect_detection@69bd48c03223 を複製し、カードを日本語で書く
88ad7bd verified
|
Raw History Blame Contribute Delete
14.2 kB
metadata
license:
  - c-uda
pretty_name: google/code_x_glue_cc_defect_detection (mirror)
source_datasets:
  - google/code_x_glue_cc_defect_detection
tags:
  - laya
  - laya-finetune
  - mirror
  - domain-code
  - use-unclear
  - genre-source-code
  - label-binary
  - annot-natural
  - lang-other
language:
  - code
task_categories:
  - text-classification
task_ids:
  - multi-class-classification
size_categories:
  - 10K<n<100K
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: validation
        path: data/validation-*
      - split: test
        path: data/test-*
dataset_info:
  features:
    - name: id
      dtype: int32
    - name: func
      dtype: string
    - name: target
      dtype: bool
    - name: project
      dtype: string
    - name: commit_id
      dtype: string
  splits:
    - name: train
      num_bytes: 45723451
      num_examples: 21854
    - name: validation
      num_bytes: 5582533
      num_examples: 2732
    - name: test
      num_bytes: 5646740
      num_examples: 2732
  download_size: 22289955
  dataset_size: 56952724

google/code_x_glue_cc_defect_detection(複製)

データの内容

C 言語のソースコードが、資源の漏れ・解放後使用・DoS などの安全でないコードかを判定する二値分類のデータ。1 行が関数 1 つ(func)で、target が 1 なら安全でないコード、0 なら安全なコードである。project と commit_id で元のプロジェクトとコミットが分かる。元は Devign(論文)のデータで、全プロジェクトを結合して学習・開発・テストに 80%・10%・10% で分けてある。

データの概要

項目 値
行数 27,318(1 構成・3 分割の合計)
列数 5
容量 22.30 MB(ファイル 5 本)
ファイルの形式 parquet 3
言語 code
公開 public

構成と分割

構成(config) 分割(split)ごとの行数 列数
default train 21,854、validation 2,732、test 2,732 5

列(構成 default・分割 train)

列 型 先頭の行の値
id int32 0
func string static av_cold int vdadec_init(AVCodecContext *a…
target bool False
project string FFmpeg
commit_id string 973b1a6b9070e2bf17d17568cbaf4043ce931f51

行数と列は HF のデータセットビューアの集計(元のデータセットの現在の版で数えたもの)。全データセットの一覧は HYUKI5/dataset-catalog にある。

複製について

google/code_x_glue_cc_defect_detection をリビジョン 69bd48c03223c2104342acd9a807caf61ac3efb8 の時点でそのまま複製したもの。中身は変えていない。判断モデル Laya(convaiinnovations/laya)の微調整に使う候補として、調査メモ(Laya 学習用データセット調査)に載せたデータを集めている。

出典

論文

  • 元のカードに論文へのリンクは見つからなかった

アノテーションの方法

データセットの作成者

https://github.com/microsoft, https://github.com/madlag

微調整に使うときの注意

  • 調査メモの台帳での区分: D(記載なし・other・unknown・資料間の食い違い)。区分は記載の文言で機械的に付けたもので、法的な判定ではない。学習に入れる前に元のカードとライセンスの原文で確かめる。
  • Laya の入力は 2,048 token まで(ModernBERT-large / mmBERT)。長い本文は先頭から黙って切られるので、切れる行は事前に除くか、要約・切り出しをしてから入れる。
  • 分割は記事・文書単位で行い、同じ本文から作った別の問いを学習側と較正側に分けない。温度と閾値は学習に使っていない分割で別々に当てる。

調査メモの記述

メモ 節 ライセンス(記載) 確認 注記
jev_sources_tasksource_bekko.csv CSV(tasksource-jev-typed-decisions) c-uda / license_use=unspecified 確認済 license_use=unspecified / [Jev 元データ source] source_annotation_converted(deterministic recast; no model r

元のカード(日本語訳)

以下は元のデータセットのカードの本文を日本語に訳したもの(機械翻訳)。訳に疑問があるときは、末尾の原文を確かめる。


Dataset Card for "code_x_glue_cc_defect_detection"

目次

  • データセットの説明
    • データセットの要約
    • 対応タスクとリーダーボード
    • 言語
  • データセットの構造
    • データの例
    • データのフィールド
    • データの分割
  • データセットの作成
    • 収集の理由
    • 元データ
    • アノテーション
    • 個人情報と機微な情報
  • データの利用上の注意
    • データセットの社会的影響
    • 偏りについての議論
    • その他の既知の制限
  • 追加情報
    • データセットの作成者
    • ライセンス情報
    • 引用情報
    • 貢献者

データセットの説明

データセットの要約

CodeXGLUE の Defect-detection データセット(https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/Defect-detection で公開)。

与えられたソースコードについて、リソースリーク、解放後使用(use-after-free)の脆弱性、DoS 攻撃など、ソフトウェアシステムを攻撃しうる安全でないコードかどうかを判定するのがタスクである。このタスクを二値分類(0/1)として扱い、1 は安全でないコード、0 は安全なコードを表す。 使用するデータセットは、論文 Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks に由来する。全プロジェクトを結合し、学習・開発・テストに 80%/10%/10% で分割している。

対応タスクとリーダーボード

  • multi-class-classification: このデータセットは、コードに欠陥が含まれるかどうかを検出するモデルの学習に使える。

言語

  • C プログラミング言語

データセットの構造

データの例

'validation' の例は次のとおり。

{
    "commit_id": "aa1530dec499f7525d2ccaa0e3a876dc8089ed1e", 
    "func": "static void filter_mirror_setup(NetFilterState *nf, Error **errp)\n{\n    MirrorState *s = FILTER_MIRROR(nf);\n    Chardev *chr;\n    chr = qemu_chr_find(s->outdev);\n    if (chr == NULL) {\n        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,\n                  \"Device '%s' not found\", s->outdev);\n    qemu_chr_fe_init(&s->chr_out, chr, errp);", 
    "id": 8, 
    "project": "qemu", 
    "target": true
}

データのフィールド

以下では、各設定(config)のフィールドを順に説明する。データのフィールドはすべての分割で共通である。

default

フィールド名 型 説明
id int32 サンプルのインデックス
func string ソースコード
target bool 0 か 1(脆弱性があるかどうか)
project string このコードを含む元のプロジェクト
commit_id string 元のプロジェクトのコミット識別子

データの分割

名前 train validation test
default 21854 2732 2732

データセットの作成

収集の理由

[More Information Needed]

元データ

初期のデータ収集と正規化

[More Information Needed]

元の言語の作成者は誰か?

[More Information Needed]

アノテーション

アノテーションの手順

[More Information Needed]

アノテーターは誰か?

[More Information Needed]

個人情報と機微な情報

[More Information Needed]

データの利用上の注意

データセットの社会的影響

[More Information Needed]

偏りについての議論

[More Information Needed]

その他の既知の制限

[More Information Needed]

追加情報

データセットの作成者

https://github.com/microsoft, https://github.com/madlag

ライセンス情報

Computational Use of Data Agreement (C-UDA) License.

引用情報

@inproceedings{zhou2019devign,
title={Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks},
author={Zhou, Yaqin and Liu, Shangqing and Siow, Jingkai and Du, Xiaoning and Liu, Yang},
booktitle={Advances in Neural Information Processing Systems},
pages={10197--10207}, year={2019}

貢献者

このデータセットを追加してくれた @madlag(および一部 @ncoop57)に感謝する。

原文(英語)

Dataset Card for "code_x_glue_cc_defect_detection"

Table of Contents

Dataset Description

Dataset Summary

CodeXGLUE Defect-detection dataset, available at https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/Defect-detection

Given a source code, the task is to identify whether it is an insecure code that may attack software systems, such as resource leaks, use-after-free vulnerabilities and DoS attack. We treat the task as binary classification (0/1), where 1 stands for insecure code and 0 for secure code. The dataset we use comes from the paper Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks. We combine all projects and split 80%/10%/10% for training/dev/test.

Supported Tasks and Leaderboards

  • multi-class-classification: The dataset can be used to train a model for detecting if code has a defect in it.

Languages

  • C programming language

Dataset Structure

Data Instances

An example of 'validation' looks as follows.

{
    "commit_id": "aa1530dec499f7525d2ccaa0e3a876dc8089ed1e", 
    "func": "static void filter_mirror_setup(NetFilterState *nf, Error **errp)\n{\n    MirrorState *s = FILTER_MIRROR(nf);\n    Chardev *chr;\n    chr = qemu_chr_find(s->outdev);\n    if (chr == NULL) {\n        error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND,\n                  \"Device '%s' not found\", s->outdev);\n    qemu_chr_fe_init(&s->chr_out, chr, errp);", 
    "id": 8, 
    "project": "qemu", 
    "target": true
}

Data Fields

In the following each data field in go is explained for each config. The data fields are the same among all splits.

default

field name type description
id int32 Index of the sample
func string The source code
target bool 0 or 1 (vulnerability or not)
project string Original project that contains this code
commit_id string Commit identifier in the original project

Data Splits

name train validation test
default 21854 2732 2732

Dataset Creation

Curation Rationale

[More Information Needed]

Source Data

Initial Data Collection and Normalization

[More Information Needed]

Who are the source language producers?

[More Information Needed]

Annotations

Annotation process

[More Information Needed]

Who are the annotators?

[More Information Needed]

Personal and Sensitive Information

[More Information Needed]

Considerations for Using the Data

Social Impact of Dataset

[More Information Needed]

Discussion of Biases

[More Information Needed]

Other Known Limitations

[More Information Needed]

Additional Information

Dataset Curators

https://github.com/microsoft, https://github.com/madlag

Licensing Information

Computational Use of Data Agreement (C-UDA) License.

Citation Information

@inproceedings{zhou2019devign,
title={Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks},
author={Zhou, Yaqin and Liu, Shangqing and Siow, Jingkai and Du, Xiaoning and Liu, Yang},
booktitle={Advances in Neural Information Processing Systems},
pages={10197--10207}, year={2019}

Contributions

Thanks to @madlag (and partly also @ncoop57) for adding this dataset.