Update files from the datasets library (from 1.16.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.16.0
- README.md +2 -1
- great_code.py +25 -27
README.md
CHANGED
|
@@ -18,9 +18,10 @@ task_categories:
|
|
| 18 |
task_ids:
|
| 19 |
- table-to-text
|
| 20 |
paperswithcode_id: null
|
|
|
|
| 21 |
---
|
| 22 |
|
| 23 |
-
# Dataset Card
|
| 24 |
|
| 25 |
## Table of Contents
|
| 26 |
- [Dataset Description](#dataset-description)
|
|
|
|
| 18 |
task_ids:
|
| 19 |
- table-to-text
|
| 20 |
paperswithcode_id: null
|
| 21 |
+
pretty_name: GREAT
|
| 22 |
---
|
| 23 |
|
| 24 |
+
# Dataset Card for GREAT
|
| 25 |
|
| 26 |
## Table of Contents
|
| 27 |
- [Dataset Description](#dataset-description)
|
great_code.py
CHANGED
|
@@ -133,30 +133,28 @@ class GreatCode(datasets.GeneratorBasedBuilder):
|
|
| 133 |
def _generate_examples(self, datapath, datatype):
|
| 134 |
for file_idx, dp in enumerate(datapath):
|
| 135 |
with open(dp, "r", encoding="utf-8") as json_file:
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
]
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
}
|
| 162 |
-
yield f"{file_idx}_{example_counter}", response
|
|
|
|
| 133 |
def _generate_examples(self, datapath, datatype):
|
| 134 |
for file_idx, dp in enumerate(datapath):
|
| 135 |
with open(dp, "r", encoding="utf-8") as json_file:
|
| 136 |
+
for example_counter, json_str in enumerate(json_file):
|
| 137 |
+
result = json.loads(json_str)
|
| 138 |
+
response = {
|
| 139 |
+
"id": example_counter,
|
| 140 |
+
"source_tokens": result["source_tokens"],
|
| 141 |
+
"has_bug": result["has_bug"],
|
| 142 |
+
"error_location": result["error_location"],
|
| 143 |
+
"repair_candidates": [str(x) for x in result["repair_candidates"]],
|
| 144 |
+
"bug_kind": result["bug_kind"],
|
| 145 |
+
"bug_kind_name": result["bug_kind_name"],
|
| 146 |
+
"repair_targets": result["repair_targets"],
|
| 147 |
+
"edges": [
|
| 148 |
+
[
|
| 149 |
+
{
|
| 150 |
+
"before_index": result["edges"][x][0],
|
| 151 |
+
"after_index": result["edges"][x][1],
|
| 152 |
+
"edge_type": result["edges"][x][2],
|
| 153 |
+
"edge_type_name": result["edges"][x][3],
|
| 154 |
+
}
|
| 155 |
+
]
|
| 156 |
+
for x in range(len(result["edges"]))
|
| 157 |
+
],
|
| 158 |
+
"provenances": result["provenances"],
|
| 159 |
+
}
|
| 160 |
+
yield f"{file_idx}_{example_counter}", response
|
|
|
|
|
|