File size: 2,892 Bytes
078456a
7eab194
259bb10
 
7eab194
87a4279
 
7eab194
 
 
078456a
72c0e46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a92199d
 
72c0e46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
viewer: true
configs:
  - config_name: default
    default: true
    data_files:
      - split: test
        path:
          - test.parquet
license: mit
---
# PrimeVul Original Test Dataset

## Overview

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.

## Citation

If you use this dataset, please cite the original PrimeVul paper:

```bibtex
@article{primevul2024,
  title={PrimeVul: Vulnerability Detection with Code Language Models: How Far Are We?},
  author={[Authors from the original paper]},
  journal={arXiv preprint arXiv:2403.18624},
  year={2024},
  url={https://arxiv.org/abs/2403.18624}
}
```

## Dataset Configurations
- **Description**: Single function vulnerability detection dataset
- **Size**: 25,911 test samples
- **Format**: Each sample contains a single code function with binary vulnerability label
- **Fields**:
  - `project`: Source project name
  - `commit_id`: Git commit hash
  - `target`: Binary label (0=non-vulnerable, 1=vulnerable)
  - `func`: Source code function
  - `cwe`: Common Weakness Enumeration categories
  - `idx`: Unique sample identifier
  - `hash`: Function hash
  - Additional metadata fields

## Data Source

The original JSONL files are available from the PrimeVul authors at:
- **Google Drive**: https://drive.google.com/drive/folders/19iLaNDS0z99N8kB_jBRTmDLehwZBolMY
- **GitHub Repository**: https://github.com/DLVulDet/PrimeVul

## Data Format

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.

## Usage

```python
from datasets import load_dataset

# Login using e.g. `huggingface-cli login` to access this dataset
ds = load_dataset("Code-TREAT/PrimeVul_original")
```

## Purpose

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:

1. **Reproduce results** from papers using this dataset
2. **Compare methods** fairly using identical test data
3. **Validate new approaches** against established benchmarks

## License

Please refer to the original PrimeVul repository for licensing information: https://github.com/DLVulDet/PrimeVul

## Acknowledgments

We thank the authors of PrimeVul for making their dataset publicly available and for their contributions to vulnerability detection research.

## Contact

For questions about this dataset distribution, please refer to the original PrimeVul repository or the Code-TREAT project.