parquet-converter commited on
Commit
53a7c81
1 Parent(s): b00e079

Update parquet files

Browse files
.gitattributes DELETED
@@ -1,27 +0,0 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bin.* filter=lfs diff=lfs merge=lfs -text
5
- *.bz2 filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.model filter=lfs diff=lfs merge=lfs -text
12
- *.msgpack filter=lfs diff=lfs merge=lfs -text
13
- *.onnx filter=lfs diff=lfs merge=lfs -text
14
- *.ot filter=lfs diff=lfs merge=lfs -text
15
- *.parquet filter=lfs diff=lfs merge=lfs -text
16
- *.pb filter=lfs diff=lfs merge=lfs -text
17
- *.pt filter=lfs diff=lfs merge=lfs -text
18
- *.pth filter=lfs diff=lfs merge=lfs -text
19
- *.rar filter=lfs diff=lfs merge=lfs -text
20
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21
- *.tar.* filter=lfs diff=lfs merge=lfs -text
22
- *.tflite filter=lfs diff=lfs merge=lfs -text
23
- *.tgz filter=lfs diff=lfs merge=lfs -text
24
- *.xz filter=lfs diff=lfs merge=lfs -text
25
- *.zip filter=lfs diff=lfs merge=lfs -text
26
- *.zstandard filter=lfs diff=lfs merge=lfs -text
27
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md DELETED
@@ -1,192 +0,0 @@
1
- ---
2
- annotations_creators:
3
- - found
4
- language_creators:
5
- - found
6
- language:
7
- - code
8
- license:
9
- - c-uda
10
- multilinguality:
11
- - other-programming-languages
12
- size_categories:
13
- - 10K<n<100K
14
- source_datasets:
15
- - original
16
- task_categories:
17
- - text-classification
18
- task_ids:
19
- - multi-class-classification
20
- pretty_name: CodeXGlueCcDefectDetection
21
- dataset_info:
22
- features:
23
- - name: id
24
- dtype: int32
25
- - name: func
26
- dtype: string
27
- - name: target
28
- dtype: bool
29
- - name: project
30
- dtype: string
31
- - name: commit_id
32
- dtype: string
33
- splits:
34
- - name: train
35
- num_bytes: 45723487
36
- num_examples: 21854
37
- - name: validation
38
- num_bytes: 5582545
39
- num_examples: 2732
40
- - name: test
41
- num_bytes: 5646752
42
- num_examples: 2732
43
- download_size: 61685715
44
- dataset_size: 56952784
45
- ---
46
- # Dataset Card for "code_x_glue_cc_defect_detection"
47
-
48
- ## Table of Contents
49
- - [Dataset Description](#dataset-description)
50
- - [Dataset Summary](#dataset-summary)
51
- - [Supported Tasks and Leaderboards](#supported-tasks)
52
- - [Languages](#languages)
53
- - [Dataset Structure](#dataset-structure)
54
- - [Data Instances](#data-instances)
55
- - [Data Fields](#data-fields)
56
- - [Data Splits](#data-splits-sample-size)
57
- - [Dataset Creation](#dataset-creation)
58
- - [Curation Rationale](#curation-rationale)
59
- - [Source Data](#source-data)
60
- - [Annotations](#annotations)
61
- - [Personal and Sensitive Information](#personal-and-sensitive-information)
62
- - [Considerations for Using the Data](#considerations-for-using-the-data)
63
- - [Social Impact of Dataset](#social-impact-of-dataset)
64
- - [Discussion of Biases](#discussion-of-biases)
65
- - [Other Known Limitations](#other-known-limitations)
66
- - [Additional Information](#additional-information)
67
- - [Dataset Curators](#dataset-curators)
68
- - [Licensing Information](#licensing-information)
69
- - [Citation Information](#citation-information)
70
- - [Contributions](#contributions)
71
-
72
- ## Dataset Description
73
-
74
- - **Homepage:** https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/Defect-detection
75
-
76
- ### Dataset Summary
77
-
78
- CodeXGLUE Defect-detection dataset, available at https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/Defect-detection
79
-
80
- 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.
81
- 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.
82
-
83
- ### Supported Tasks and Leaderboards
84
-
85
- - `multi-class-classification`: The dataset can be used to train a model for detecting if code has a defect in it.
86
-
87
- ### Languages
88
-
89
- - C **programming** language
90
-
91
- ## Dataset Structure
92
-
93
- ### Data Instances
94
-
95
- An example of 'validation' looks as follows.
96
- ```
97
- {
98
- "commit_id": "aa1530dec499f7525d2ccaa0e3a876dc8089ed1e",
99
- "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);",
100
- "id": 8,
101
- "project": "qemu",
102
- "target": true
103
- }
104
- ```
105
-
106
- ### Data Fields
107
-
108
- In the following each data field in go is explained for each config. The data fields are the same among all splits.
109
-
110
- #### default
111
-
112
- |field name| type | description |
113
- |----------|------|------------------------------------------|
114
- |id |int32 | Index of the sample |
115
- |func |string| The source code |
116
- |target |bool | 0 or 1 (vulnerability or not) |
117
- |project |string| Original project that contains this code |
118
- |commit_id |string| Commit identifier in the original project|
119
-
120
- ### Data Splits
121
-
122
- | name |train|validation|test|
123
- |-------|----:|---------:|---:|
124
- |default|21854| 2732|2732|
125
-
126
- ## Dataset Creation
127
-
128
- ### Curation Rationale
129
-
130
- [More Information Needed]
131
-
132
- ### Source Data
133
-
134
- #### Initial Data Collection and Normalization
135
-
136
- [More Information Needed]
137
-
138
- #### Who are the source language producers?
139
-
140
- [More Information Needed]
141
-
142
- ### Annotations
143
-
144
- #### Annotation process
145
-
146
- [More Information Needed]
147
-
148
- #### Who are the annotators?
149
-
150
- [More Information Needed]
151
-
152
- ### Personal and Sensitive Information
153
-
154
- [More Information Needed]
155
-
156
- ## Considerations for Using the Data
157
-
158
- ### Social Impact of Dataset
159
-
160
- [More Information Needed]
161
-
162
- ### Discussion of Biases
163
-
164
- [More Information Needed]
165
-
166
- ### Other Known Limitations
167
-
168
- [More Information Needed]
169
-
170
- ## Additional Information
171
-
172
- ### Dataset Curators
173
-
174
- https://github.com/microsoft, https://github.com/madlag
175
-
176
- ### Licensing Information
177
-
178
- Computational Use of Data Agreement (C-UDA) License.
179
-
180
- ### Citation Information
181
-
182
- ```
183
- @inproceedings{zhou2019devign,
184
- title={Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks},
185
- author={Zhou, Yaqin and Liu, Shangqing and Siow, Jingkai and Du, Xiaoning and Liu, Yang},
186
- booktitle={Advances in Neural Information Processing Systems},
187
- pages={10197--10207}, year={2019}
188
- ```
189
-
190
- ### Contributions
191
-
192
- Thanks to @madlag (and partly also @ncoop57) for adding this dataset.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
code_x_glue_cc_defect_detection.py DELETED
@@ -1,78 +0,0 @@
1
- from typing import List
2
-
3
- import datasets
4
-
5
- from .common import TrainValidTestChild
6
- from .generated_definitions import DEFINITIONS
7
-
8
-
9
- _DESCRIPTION = """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.
10
- 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."""
11
- _CITATION = """@inproceedings{zhou2019devign,
12
- title={Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks},
13
- author={Zhou, Yaqin and Liu, Shangqing and Siow, Jingkai and Du, Xiaoning and Liu, Yang},
14
- booktitle={Advances in Neural Information Processing Systems},
15
- pages={10197--10207}, year={2019}"""
16
-
17
-
18
- class CodeXGlueCcDefectDetectionImpl(TrainValidTestChild):
19
- _DESCRIPTION = _DESCRIPTION
20
- _CITATION = _CITATION
21
-
22
- _FEATURES = {
23
- "id": datasets.Value("int32"), # Index of the sample
24
- "func": datasets.Value("string"), # The source code
25
- "target": datasets.Value("bool"), # 0 or 1 (vulnerability or not)
26
- "project": datasets.Value("string"), # Original project that contains this code
27
- "commit_id": datasets.Value("string"), # Commit identifier in the original project
28
- }
29
- _SUPERVISED_KEYS = ["target"]
30
-
31
- def generate_urls(self, split_name):
32
- yield "index", f"{split_name}.txt"
33
- yield "data", "function.json"
34
-
35
- def _generate_examples(self, split_name, file_paths):
36
- import json
37
-
38
- js_all = json.load(open(file_paths["data"], encoding="utf-8"))
39
-
40
- index = set()
41
- with open(file_paths["index"], encoding="utf-8") as f:
42
- for line in f:
43
- line = line.strip()
44
- index.add(int(line))
45
-
46
- for idx, js in enumerate(js_all):
47
- if idx in index:
48
- js["id"] = idx
49
- js["target"] = int(js["target"]) == 1
50
- yield idx, js
51
-
52
-
53
- CLASS_MAPPING = {
54
- "CodeXGlueCcDefectDetection": CodeXGlueCcDefectDetectionImpl,
55
- }
56
-
57
-
58
- class CodeXGlueCcDefectDetection(datasets.GeneratorBasedBuilder):
59
- BUILDER_CONFIG_CLASS = datasets.BuilderConfig
60
- BUILDER_CONFIGS = [
61
- datasets.BuilderConfig(name=name, description=info["description"]) for name, info in DEFINITIONS.items()
62
- ]
63
-
64
- def _info(self):
65
- name = self.config.name
66
- info = DEFINITIONS[name]
67
- if info["class_name"] in CLASS_MAPPING:
68
- self.child = CLASS_MAPPING[info["class_name"]](info)
69
- else:
70
- raise RuntimeError(f"Unknown python class for dataset configuration {name}")
71
- ret = self.child._info()
72
- return ret
73
-
74
- def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
75
- return self.child._split_generators(dl_manager=dl_manager)
76
-
77
- def _generate_examples(self, split_name, file_paths):
78
- return self.child._generate_examples(split_name, file_paths)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
common.py DELETED
@@ -1,75 +0,0 @@
1
- from typing import List
2
-
3
- import datasets
4
-
5
-
6
- # Citation, taken from https://github.com/microsoft/CodeXGLUE
7
- _DEFAULT_CITATION = """@article{CodeXGLUE,
8
- title={CodeXGLUE: A Benchmark Dataset and Open Challenge for Code Intelligence},
9
- year={2020},}"""
10
-
11
-
12
- class Child:
13
- _DESCRIPTION = None
14
- _FEATURES = None
15
- _CITATION = None
16
- SPLITS = {"train": datasets.Split.TRAIN}
17
- _SUPERVISED_KEYS = None
18
-
19
- def __init__(self, info):
20
- self.info = info
21
-
22
- def homepage(self):
23
- return self.info["project_url"]
24
-
25
- def _info(self):
26
- # This is the description that will appear on the datasets page.
27
- return datasets.DatasetInfo(
28
- description=self.info["description"] + "\n\n" + self._DESCRIPTION,
29
- features=datasets.Features(self._FEATURES),
30
- homepage=self.homepage(),
31
- citation=self._CITATION or _DEFAULT_CITATION,
32
- supervised_keys=self._SUPERVISED_KEYS,
33
- )
34
-
35
- def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
36
- SPLITS = self.SPLITS
37
- _URL = self.info["raw_url"]
38
- urls_to_download = {}
39
- for split in SPLITS:
40
- if split not in urls_to_download:
41
- urls_to_download[split] = {}
42
-
43
- for key, url in self.generate_urls(split):
44
- if not url.startswith("http"):
45
- url = _URL + "/" + url
46
- urls_to_download[split][key] = url
47
-
48
- downloaded_files = {}
49
- for k, v in urls_to_download.items():
50
- downloaded_files[k] = dl_manager.download_and_extract(v)
51
-
52
- return [
53
- datasets.SplitGenerator(
54
- name=SPLITS[k],
55
- gen_kwargs={"split_name": k, "file_paths": downloaded_files[k]},
56
- )
57
- for k in SPLITS
58
- ]
59
-
60
- def check_empty(self, entries):
61
- all_empty = all([v == "" for v in entries.values()])
62
- all_non_empty = all([v != "" for v in entries.values()])
63
-
64
- if not all_non_empty and not all_empty:
65
- raise RuntimeError("Parallel data files should have the same number of lines.")
66
-
67
- return all_empty
68
-
69
-
70
- class TrainValidTestChild(Child):
71
- SPLITS = {
72
- "train": datasets.Split.TRAIN,
73
- "valid": datasets.Split.VALIDATION,
74
- "test": datasets.Split.TEST,
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dataset_infos.json DELETED
@@ -1 +0,0 @@
1
- {"default": {"description": "CodeXGLUE Defect-detection dataset, available at https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/Defect-detection\n\nGiven 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.\nThe 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.", "citation": "@inproceedings{zhou2019devign,\ntitle={Devign: Effective vulnerability identification by learning comprehensive program semantics via graph neural networks},\nauthor={Zhou, Yaqin and Liu, Shangqing and Siow, Jingkai and Du, Xiaoning and Liu, Yang},\nbooktitle={Advances in Neural Information Processing Systems},\npages={10197--10207}, year={2019}", "homepage": "https://github.com/madlag/CodeXGLUE/tree/main/Code-Code/Defect-detection", "license": "", "features": {"id": {"dtype": "int32", "id": null, "_type": "Value"}, "func": {"dtype": "string", "id": null, "_type": "Value"}, "target": {"dtype": "bool", "id": null, "_type": "Value"}, "project": {"dtype": "string", "id": null, "_type": "Value"}, "commit_id": {"dtype": "string", "id": null, "_type": "Value"}}, "post_processed": null, "supervised_keys": {"input": "target", "output": ""}, "task_templates": null, "builder_name": "code_x_glue_cc_defect_detection", "config_name": "default", "version": {"version_str": "0.0.0", "description": null, "major": 0, "minor": 0, "patch": 0}, "splits": {"train": {"name": "train", "num_bytes": 45723487, "num_examples": 21854, "dataset_name": "code_x_glue_cc_defect_detection"}, "validation": {"name": "validation", "num_bytes": 5582545, "num_examples": 2732, "dataset_name": "code_x_glue_cc_defect_detection"}, "test": {"name": "test", "num_bytes": 5646752, "num_examples": 2732, "dataset_name": "code_x_glue_cc_defect_detection"}}, "download_checksums": {"https://raw.githubusercontent.com/madlag/CodeXGLUE/main/Code-Code/Defect-detection/dataset/train.txt": {"num_bytes": 122185, "checksum": "f0a25410594302a9f0e542a393ad82ad479308a8aa471f4d6cf61b91d6d572bf"}, "https://raw.githubusercontent.com/madlag/CodeXGLUE/main/Code-Code/Defect-detection/dataset/function.json": {"num_bytes": 61532917, "checksum": "0a3b2d561dc6280e53795886ede727d0045c016d083905ba3e9ce384a7eab246"}, "https://raw.githubusercontent.com/madlag/CodeXGLUE/main/Code-Code/Defect-detection/dataset/valid.txt": {"num_bytes": 15295, "checksum": "9f2fa1e108955f197d4a7fa2aa2c7f5e542457b51e0eb1f6e890172d6f700a6e"}, "https://raw.githubusercontent.com/madlag/CodeXGLUE/main/Code-Code/Defect-detection/dataset/test.txt": {"num_bytes": 15318, "checksum": "b5336b337170ea1edf0570b69edb5a90e3c99bf41cd92909795f5fe32d376d52"}}, "download_size": 61685715, "post_processing_size": null, "dataset_size": 56952784, "size_in_bytes": 118638499}}
 
 
default/code_x_glue_cc_defect_detection-test.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ba20d249a456a4b535ce47abfda5400a15e5b6f8e501fe18a8917a9884135e5c
3
+ size 2227969
default/code_x_glue_cc_defect_detection-train.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f82cb22c3902d61db04f41f8cbfbbec11cbe42464feefa7bc7faa25a7aa99689
3
+ size 17847669
default/code_x_glue_cc_defect_detection-validation.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1181ce64199d658fd426b562b350e5fee86937e5d14f1580b02558b5ed348bd
3
+ size 2214314
generated_definitions.py DELETED
@@ -1,12 +0,0 @@
1
- DEFINITIONS = {
2
- "default": {
3
- "class_name": "CodeXGlueCcDefectDetection",
4
- "dataset_type": "Code-Code",
5
- "description": "CodeXGLUE Defect-detection dataset, available at https://github.com/microsoft/CodeXGLUE/tree/main/Code-Code/Defect-detection",
6
- "dir_name": "Defect-detection",
7
- "name": "default",
8
- "project_url": "https://github.com/madlag/CodeXGLUE/tree/main/Code-Code/Defect-detection",
9
- "raw_url": "https://raw.githubusercontent.com/madlag/CodeXGLUE/main/Code-Code/Defect-detection/dataset",
10
- "sizes": {"test": 2732, "train": 21854, "validation": 2732},
11
- }
12
- }