File size: 2,149 Bytes
1959c92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
db312ad
 
 
1959c92
65d392a
 
db312ad
 
 
 
 
65d392a
 
db312ad
 
 
 
 
65d392a
 
 
 
 
db312ad
 
 
 
 
 
65d392a
 
db312ad
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
---
dataset_info:
  features:
  - name: input
    dtype: string
  - name: output
    dtype: string
  splits:
  - name: validation
    num_bytes: 15586336
    num_examples: 15809
  - name: train
    num_bytes: 125099945
    num_examples: 126477
  - name: test
    num_bytes: 15640963
    num_examples: 15810
  download_size: 33528231
  dataset_size: 156327244
---
### Dataset is imported from CodeXGLUE and pre-processed using their script.

# Where to find in Semeru:

The dataset can be found at /nfs/semeru/semeru_datasets/code_xglue/code-to-code/Defect-detection in Semeru


# CodeXGLUE -- Defect Detection

## [](https://huggingface.co/datasets/semeru/code-code-DefectDetection#task-definition)Task Definition

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.

### [](https://huggingface.co/datasets/semeru/code-code-DefectDetection#dataset)Dataset

The dataset we use comes from the paper  [_Devign_: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networks](http://papers.nips.cc/paper/9209-devign-effective-vulnerability-identification-by-learning-comprehensive-program-semantics-via-graph-neural-networks.pdf). We combine all projects and split 80%/10%/10% for training/dev/test.

### [](https://huggingface.co/datasets/semeru/code-code-DefectDetection#data-format)Data Format

Three pre-processed .jsonl files, i.e. train.jsonl, valid.jsonl, test.jsonl are present

For each file, each line in the uncompressed file represents one function. One row is illustrated below.

-   **func:**  the source code
-   **target:**  0 or 1 (vulnerability or not)
-   **idx:**  the index of example

### [](https://huggingface.co/datasets/semeru/code-code-DefectDetection#data-statistics)Data Statistics

Data statistics of the dataset are shown in the below table:



| | Description |
| ----------- | ----------- |
| Train| 126,477|
| Dev| 15,809|
|Test|15,810