Code-TREAT commited on
Commit
6aa39ac
·
verified ·
1 Parent(s): 9cdad4c

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +90 -0
README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ viewer: true
3
+ configs:
4
+ - config_name: default
5
+ default: true
6
+ data_files:
7
+ - split: test
8
+ path:
9
+ - test.parquet
10
+ license: mit
11
+ ---
12
+ # PrimeVul Original Test Dataset (Lite for reproducing Code-TREAT results)
13
+
14
+ ## Overview
15
+
16
+ This dataset contains the original test split from the PrimeVul dataset, provided for reproducibility purposes. The data is sourced from the paper "PrimeVul: Vulnerability Detection with Code Language Models: How Far Are We?" and includes both the default (single functions) and paired (vulnerable/non-vulnerable pairs) configurations.
17
+
18
+ ## Citation
19
+
20
+ If you use this dataset, please cite the original PrimeVul paper:
21
+
22
+ ```bibtex
23
+ @article{primevul2024,
24
+ title={PrimeVul: Vulnerability Detection with Code Language Models: How Far Are We?},
25
+ author={[Authors from the original paper]},
26
+ journal={arXiv preprint arXiv:2403.18624},
27
+ year={2024},
28
+ url={https://arxiv.org/abs/2403.18624}
29
+ }
30
+ ```
31
+
32
+ ## Dataset Configurations
33
+ - **Description**: Single function vulnerability detection dataset
34
+ - **Size**: 25,911 test samples
35
+ - **Format**: Each sample contains a single code function with binary vulnerability label
36
+ - **Fields**:
37
+ - `project`: Source project name
38
+ - `commit_id`: Git commit hash
39
+ - `target`: Binary label (0=non-vulnerable, 1=vulnerable)
40
+ - `func`: Source code function
41
+ - `cwe`: Common Weakness Enumeration categories
42
+ - `idx`: Unique sample identifier
43
+ - `hash`: Function hash
44
+ - Additional metadata fields
45
+
46
+ ## Data Source
47
+
48
+ The original JSONL files are available from the PrimeVul authors at:
49
+ - **Google Drive**: https://drive.google.com/drive/folders/19iLaNDS0z99N8kB_jBRTmDLehwZBolMY
50
+ - **GitHub Repository**: https://github.com/DLVulDet/PrimeVul
51
+
52
+ ## Data Format
53
+
54
+ This dataset provides the test splits in Parquet format for easy loading with HuggingFace datasets. The original data was in JSONL format and has been converted while preserving all original fields and values.
55
+
56
+ ## Usage
57
+
58
+ ```python
59
+ from datasets import load_dataset
60
+
61
+ # Load the default configuration (single functions)
62
+ dataset_default = load_dataset("Code-TREAT/PrimeVul_original", "default")
63
+
64
+ # Load the paired configuration
65
+ dataset_paired = load_dataset("Code-TREAT/PrimeVul_original", "paired")
66
+
67
+ # Access test split
68
+ test_data_default = dataset_default["test"]
69
+ test_data_paired = dataset_paired["test"]
70
+ ```
71
+
72
+ ## Purpose
73
+
74
+ This dataset is provided by the Code-TREAT project to ensure reproducibility and consistency in vulnerability detection research. By providing the exact test splits used in evaluations, researchers can:
75
+
76
+ 1. **Reproduce results** from papers using this dataset
77
+ 2. **Compare methods** fairly using identical test data
78
+ 3. **Validate new approaches** against established benchmarks
79
+
80
+ ## License
81
+
82
+ Please refer to the original PrimeVul repository for licensing information: https://github.com/DLVulDet/PrimeVul
83
+
84
+ ## Acknowledgments
85
+
86
+ We thank the authors of PrimeVul for making their dataset publicly available and for their contributions to vulnerability detection research.
87
+
88
+ ## Contact
89
+
90
+ For questions about this dataset distribution, please refer to the original PrimeVul repository or the Code-TREAT project.