dimsmauls commited on
Commit
97a30ea
·
verified ·
1 Parent(s): 3630fe5

Add training CSV (3,063 instruction-code pairs) and document it

Browse files
Files changed (2) hide show
  1. README.md +31 -0
  2. code4ml_annotated_training.csv +3 -0
README.md CHANGED
@@ -22,6 +22,10 @@ configs:
22
  data_files:
23
  - split: train
24
  path: code4ml_annotated.csv
 
 
 
 
25
  ---
26
 
27
  # Code4ML Annotated Subset with SonarQube and MLScent Ratings
@@ -137,6 +141,30 @@ No rows were removed or modified; duplicates and short snippets are kept as in t
137
  3. The data was split into two halves, each rated by its own SonarQube + MLScent instance
138
  pair, then merged back by `id`.
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  ## Usage
141
 
142
  ```python
@@ -144,6 +172,9 @@ from datasets import load_dataset
144
 
145
  ds = load_dataset("dimsmauls/code4ml-annotated-rated", split="train")
146
  print(ds[0]["graph_vertex_class"], ds[0]["combined_rating"], ds[0]["code_block"])
 
 
 
147
  ```
148
 
149
  ## Provenance & attribution
 
22
  data_files:
23
  - split: train
24
  path: code4ml_annotated.csv
25
+ - config_name: training
26
+ data_files:
27
+ - split: train
28
+ path: code4ml_annotated_training.csv
29
  ---
30
 
31
  # Code4ML Annotated Subset with SonarQube and MLScent Ratings
 
141
  3. The data was split into two halves, each rated by its own SonarQube + MLScent instance
142
  pair, then merged back by `id`.
143
 
144
+ ## Training file
145
+
146
+ `code4ml_annotated_training.csv` holds 3,063 instruction–code pairs built from
147
+ `code4ml_annotated.csv` for fine-tuning:
148
+
149
+ | Step | Rule | Rows dropped |
150
+ |---|---|---:|
151
+ | 1 | Drop task classes without ML logic: `Debug`, `Environment`, `Other` | 2,259 |
152
+ | 2 | Drop `combined_rating` = N/A | 2,502 |
153
+ | 2 | Drop `combined_rating` = D or E (quality floor) | 121 |
154
+ | 3 | Drop duplicate `code_block` | 0 |
155
+ | 4 | Turn the subclass label into an instruction, e.g. `train_model` → "Write Python code to train the model." | — |
156
+ | 5 | Drop snippets whose 8-grams overlap a DS-1000 reference solution by ≥ 50% | 2 |
157
+ | 6 | Split 80/10/10 per task class with seed 42 | — |
158
+
159
+ | Column | Description |
160
+ |---|---|
161
+ | `id` | row `id` in `code4ml_annotated.csv` |
162
+ | `split` | `train` (2,451), `validation` (308), or `test` (304) |
163
+ | `graph_vertex_class`, `graph_vertex_subclass` | Code4ML task label |
164
+ | `instruction` | instruction sentence built from the subclass label |
165
+ | `code` | the snippet |
166
+ | `combined_rating` | `A` (2,122), `B` (868), or `C` (73) |
167
+
168
  ## Usage
169
 
170
  ```python
 
172
 
173
  ds = load_dataset("dimsmauls/code4ml-annotated-rated", split="train")
174
  print(ds[0]["graph_vertex_class"], ds[0]["combined_rating"], ds[0]["code_block"])
175
+
176
+ train = load_dataset("dimsmauls/code4ml-annotated-rated", "training", split="train")
177
+ train_set = train.filter(lambda row: row["split"] == "train")
178
  ```
179
 
180
  ## Provenance & attribution
code4ml_annotated_training.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a363f17fe6e28bd2d3a06ea99021f2a63b9c571f2ec83a22d617be1fbe92fa03
3
+ size 959034