Remove cap documentation
Browse files
README.md
CHANGED
|
@@ -63,7 +63,7 @@ through the Hugging Face revision or Git tag:
|
|
| 63 |
|---|---|---|
|
| 64 |
| v1 | `v1.0.0` | Original published datasets, including the original source text and AST graphs. |
|
| 65 |
| 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. Devign is not included. |
|
| 66 |
-
| 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
|
| 67 |
|
| 68 |
For example:
|
| 69 |
|
|
@@ -201,42 +201,8 @@ The following rules define the published MIL samples.
|
|
| 201 |
function has its frozen positive `func_label`; all retained labels and
|
| 202 |
function order are preserved.
|
| 203 |
|
| 204 |
-
## Optional Training-time function caps
|
| 205 |
-
|
| 206 |
-
The published JSONL files contain the full function lists. HAM-Net training,
|
| 207 |
-
however, uses an optional deterministic cap of at most 16 functions per bag to
|
| 208 |
-
control GPU memory and runtime. The cap does not modify the released JSONL files.
|
| 209 |
-
It is applied only by the training data loader.
|
| 210 |
-
|
| 211 |
-
For each bag, cap generation follows this procedure:
|
| 212 |
-
|
| 213 |
-
1. Discard only candidate functions whose source is empty or whose AST has no nodes;
|
| 214 |
-
the remaining functions keep their original order and indices.
|
| 215 |
-
2. Score each valid function as
|
| 216 |
-
`log(1 + node_count) + 0.3 * log(1 + edge_count)`.
|
| 217 |
-
3. Rank candidates by score, then by node count, source start line, and original
|
| 218 |
-
index as deterministic tie-breakers. Select the top 12 candidates first.
|
| 219 |
-
4. If more functions are available, select additional candidates by evenly covering
|
| 220 |
-
the remaining ranked list until the bag contains at most 16 functions. Bags with
|
| 221 |
-
16 or fewer valid functions retain all valid functions.
|
| 222 |
-
5. Write the selected zero-based function indices and the policy metadata to the cap
|
| 223 |
-
file under the stable bag identifier. Cap files are generated separately for each
|
| 224 |
-
dataset revision and must be used only with the matching JSONL files.
|
| 225 |
-
|
| 226 |
-
At training time, the data loader reads the cap entry for each bag and replaces the
|
| 227 |
-
full function list with the recorded indices before constructing the model input.
|
| 228 |
-
The same label-agnostic procedure is therefore shared across datasets and models.
|
| 229 |
-
|
| 230 |
## Files
|
| 231 |
|
| 232 |
- Both versions: `promise_java.jsonl`, `defactors_python.jsonl`,
|
| 233 |
`bugsinpy_python.jsonl`, and `bigvul_c.jsonl`.
|
| 234 |
- v1 only: `devign_c.jsonl`.
|
| 235 |
-
- Each revision contains a `caps/` directory. Its cap files are generated from the
|
| 236 |
-
JSONL files in that same revision using the deterministic `ast_topk_v1` policy.
|
| 237 |
-
v1 has caps for all five datasets; v2.0.0 and v2.0.1 have caps for their four
|
| 238 |
-
MIL datasets only.
|
| 239 |
-
- `caps/caps_summary.json` records the input bag count, cap-entry count, selected
|
| 240 |
-
function count, and any bags omitted because they contain no valid function with
|
| 241 |
-
both non-empty code and a non-empty AST. A cap file must only be used with the
|
| 242 |
-
JSONL files from the same revision.
|
|
|
|
| 63 |
|---|---|---|
|
| 64 |
| v1 | `v1.0.0` | Original published datasets, including the original source text and AST graphs. |
|
| 65 |
| 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. Devign is not included. |
|
| 66 |
+
| 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. Devign is not included. |
|
| 67 |
|
| 68 |
For example:
|
| 69 |
|
|
|
|
| 201 |
function has its frozen positive `func_label`; all retained labels and
|
| 202 |
function order are preserved.
|
| 203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
## Files
|
| 205 |
|
| 206 |
- Both versions: `promise_java.jsonl`, `defactors_python.jsonl`,
|
| 207 |
`bugsinpy_python.jsonl`, and `bigvul_c.jsonl`.
|
| 208 |
- v1 only: `devign_c.jsonl`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|