Scream9371 commited on
Commit
22b0876
·
verified ·
1 Parent(s): 05aa5d8

Keep only the paper dataset release

Browse files

Remove abandoned training-time caps and document the single dataset revision used by the HAM-Net paper.

Files changed (1) hide show
  1. README.md +15 -33
README.md CHANGED
@@ -52,26 +52,17 @@ A simplified MIL record looks like:
52
  `func_label` is present only when it can be derived from patch or line-level
53
  annotations. It is not available for PROMISE.
54
 
55
- ## Published versions
56
 
57
- The repository keeps the original JSONL filenames in every version. Select a version
58
- through the Hugging Face revision or Git tag:
59
-
60
- | Version | Revision | Description |
61
- |---|---|---|
62
- | v1 | `v1.0.0` | Reproducibility release for the original HAM-Net CPDP protocol: preserves the original bag identities and order, retains original source text and comments, removes the build-time function-count and 800-node AST limits, and includes the legacy CPDP splits. |
63
- | v2.0.0 | `v2.0.0` | Reconstructed PROMISE, Defactors, BugsInPy, and Big-Vul from normalized source. Comments/docstrings and non-literal blank lines are removed; Python docstring-only suites are replaced with synthetic `pass` so every v1 bag/function remains. Labels are frozen and AST graphs are regenerated. |
64
- | v2.0.1 | `v2.0.1` | Reconstructed the same four datasets without synthetic code. Python docstring-only functions/classes are deleted; bags that become empty, or positive bags with no remaining positive function, are deleted. Remaining bag/function labels are frozen and AST graphs are regenerated. |
65
-
66
- For example:
67
 
68
  ```bash
69
  hf download Scream9371/hamnet-datasets promise_java.jsonl --revision v1.0.0
70
- hf download Scream9371/hamnet-datasets promise_java.jsonl --revision v2.0.0
71
- hf download Scream9371/hamnet-datasets promise_java.jsonl --revision v2.0.1
72
  ```
73
 
74
- ### v1.0.0 reproducibility contract
75
 
76
  `v1.0.0` is pinned to the four JSONL files at repository root and the fixed
77
  CPDP files under `splits/cpdp/`. The JSONL files preserve the bag identity and
@@ -79,10 +70,8 @@ order used by the original local HAM-Net experiments, while each bag contains
79
  the complete parseable function list. Source text retains comments and AST
80
  graphs are not truncated at 800 nodes.
81
 
82
- Matching deterministic training-time caps are under `caps/v1.0.0/`
83
- (`ast_topk_v1`, `K=16`, `top_m=12`). Do not reuse caps generated for the
84
- earlier function-capped bags: their indices are not valid for the unbounded
85
- PROMISE and Defactors bags.
86
 
87
  The BugsInPy CPDP split intentionally contains the 2,416 bags used by the
88
  original HAM-Net experiment repository.
@@ -166,8 +155,8 @@ The following rules define the published MIL samples.
166
  sampling quota targets files in the same directory or top-level module when such
167
  candidates exist; remaining candidates are sampled from the other files.
168
  - Function sampling: use seed 42, discard files with no parseable function, and
169
- retain the complete parseable function list in the published full-function version.
170
- Both releases also exclude bags that contain no function definition: older
171
  construction artifacts represented them as a single ``<file>`` placeholder,
172
  which is not a valid MIL instance.
173
 
@@ -188,7 +177,7 @@ The following rules define the published MIL samples.
188
  - Function sampling: discard files with fewer than three parseable functions and
189
  retain all remaining functions in the full-function version.
190
 
191
- ### AST and version rules
192
 
193
  - To make ASTs from Java, Python, C, and C++ comparable, language-specific node
194
  types are mapped to a shared set of structural roles, such as declarations,
@@ -197,18 +186,11 @@ The following rules define the published MIL samples.
197
  language-specific lexical details. Identifiers, punctuation, comments, and
198
  documentation text are not retained as structural AST nodes. The normalized
199
  graph contains parent-child structure, reverse edges, and self-loops.
200
- - In v2.0.0 and v2.0.1, comments are removed with language-aware lexical
201
- scanning while string and character literals are retained. Function labels
202
- are derived before source normalization; no defect label is recomputed from
203
- normalized source positions.
204
- - v2.0.0 replaces a Python function/class body consisting solely of a docstring
205
- with synthetic `pass`, retaining all v1 bags and functions.
206
- - v2.0.1 instead deletes Python docstring-only functions and classes. It omits
207
- a bag if no functions remain, and omits a positive bag if no remaining
208
- function has its frozen positive `func_label`; all retained labels and
209
- function order are preserved.
210
 
211
  ## Files
212
 
213
- - Both versions: `promise_java.jsonl`, `defactors_python.jsonl`,
214
- `bugsinpy_python.jsonl`, and `bigvul_c.jsonl`.
 
 
 
 
52
  `func_label` is present only when it can be derived from patch or line-level
53
  annotations. It is not available for PROMISE.
54
 
55
+ ## Reproducibility release
56
 
57
+ The repository contains the dataset revision used by the HAM-Net paper's fixed
58
+ CPDP experiments. The `main` branch and the immutable `v1.0.0` tag contain the
59
+ same four JSONL files and matching split files. To pin the paper revision:
 
 
 
 
 
 
 
60
 
61
  ```bash
62
  hf download Scream9371/hamnet-datasets promise_java.jsonl --revision v1.0.0
 
 
63
  ```
64
 
65
+ ### Reproducibility contract
66
 
67
  `v1.0.0` is pinned to the four JSONL files at repository root and the fixed
68
  CPDP files under `splits/cpdp/`. The JSONL files preserve the bag identity and
 
70
  the complete parseable function list. Source text retains comments and AST
71
  graphs are not truncated at 800 nodes.
72
 
73
+ The paper experiments use the complete function bags. No deterministic
74
+ training-time caps are provided or used by this release.
 
 
75
 
76
  The BugsInPy CPDP split intentionally contains the 2,416 bags used by the
77
  original HAM-Net experiment repository.
 
155
  sampling quota targets files in the same directory or top-level module when such
156
  candidates exist; remaining candidates are sampled from the other files.
157
  - Function sampling: use seed 42, discard files with no parseable function, and
158
+ retain the complete parseable function list. This release also excludes bags
159
+ that contain no function definition: older
160
  construction artifacts represented them as a single ``<file>`` placeholder,
161
  which is not a valid MIL instance.
162
 
 
177
  - Function sampling: discard files with fewer than three parseable functions and
178
  retain all remaining functions in the full-function version.
179
 
180
+ ### AST normalization rules
181
 
182
  - To make ASTs from Java, Python, C, and C++ comparable, language-specific node
183
  types are mapped to a shared set of structural roles, such as declarations,
 
186
  language-specific lexical details. Identifiers, punctuation, comments, and
187
  documentation text are not retained as structural AST nodes. The normalized
188
  graph contains parent-child structure, reverse edges, and self-loops.
 
 
 
 
 
 
 
 
 
 
189
 
190
  ## Files
191
 
192
+ - `promise_java.jsonl`
193
+ - `defactors_python.jsonl`
194
+ - `bugsinpy_python.jsonl`
195
+ - `bigvul_c.jsonl`
196
+ - `splits/cpdp/`: fixed project-disjoint splits used by the paper