Code-TREAT commited on
Commit
7fdc326
·
verified ·
1 Parent(s): 416003d

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +93 -0
README.md ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-Paired Original Test Dataset (Lite for reproducing Code-TREAT results)
13
+
14
+ ## Overview
15
+
16
+ This dataset contains the original paired 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**: Paired vulnerability detection dataset with before/after patch pairs
34
+ - **Size**: 870 test samples
35
+ - **Format**: Each sample represents either the vulnerable or patched version of a function
36
+ - **Fields**:
37
+ - `idx`: Unique sample identifier
38
+ - `project`: Source project name
39
+ - `commit_id`: Git commit hash
40
+ - `target`: Binary label (0=non-vulnerable, 1=vulnerable)
41
+ - `func`: Source code function
42
+ - `func_hash`: Function hash
43
+ - `cwe`: Common Weakness Enumeration categories
44
+ - `cve`: CVE identifier (if applicable)
45
+ - `project_url`: Source project repository URL
46
+ - `commit_url`: Direct link to the commit
47
+ - Additional metadata fields
48
+
49
+ ## Data Source
50
+
51
+ The original JSONL files are available from the PrimeVul authors at:
52
+ - **Google Drive**: https://drive.google.com/drive/folders/19iLaNDS0z99N8kB_jBRTmDLehwZBolMY
53
+ - **GitHub Repository**: https://github.com/DLVulDet/PrimeVul
54
+
55
+ ## Data Format
56
+
57
+ 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.
58
+
59
+ ## Usage
60
+
61
+ ```python
62
+ from datasets import load_dataset
63
+
64
+ # Load the default configuration (single functions)
65
+ dataset_default = load_dataset("Code-TREAT/PrimeVul_original", "default")
66
+
67
+ # Load the paired configuration
68
+ dataset_paired = load_dataset("Code-TREAT/PrimeVul_original", "paired")
69
+
70
+ # Access test split
71
+ test_data_default = dataset_default["test"]
72
+ test_data_paired = dataset_paired["test"]
73
+ ```
74
+
75
+ ## Purpose
76
+
77
+ 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:
78
+
79
+ 1. **Reproduce results** from papers using this dataset
80
+ 2. **Compare methods** fairly using identical test data
81
+ 3. **Validate new approaches** against established benchmarks
82
+
83
+ ## License
84
+
85
+ Please refer to the original PrimeVul repository for licensing information: https://github.com/DLVulDet/PrimeVul
86
+
87
+ ## Acknowledgments
88
+
89
+ We thank the authors of PrimeVul for making their dataset publicly available and for their contributions to vulnerability detection research.
90
+
91
+ ## Contact
92
+
93
+ For questions about this dataset distribution, please refer to the original PrimeVul repository or the Code-TREAT project.