Upload Hi-ToM.py
Browse filesNew loading script
Hi-ToM.py
CHANGED
|
@@ -43,8 +43,8 @@ class MyCustomDataset(DatasetBuilder):
|
|
| 43 |
|
| 44 |
def _generate_examples(self, filepath):
|
| 45 |
with open(filepath, encoding="utf-8") as f:
|
| 46 |
-
data = json.load(f)
|
| 47 |
-
for id, item in enumerate(data
|
| 48 |
yield id, {
|
| 49 |
"prompting_type": item["prompting_type"],
|
| 50 |
"deception": item["deception"],
|
|
@@ -56,5 +56,4 @@ class MyCustomDataset(DatasetBuilder):
|
|
| 56 |
"choices": item["choices"],
|
| 57 |
"answer": item["answer"],
|
| 58 |
}
|
| 59 |
-
|
| 60 |
# Replace 'MyCustomDataset' with a suitable name that follows Python class naming conventions.
|
|
|
|
| 43 |
|
| 44 |
def _generate_examples(self, filepath):
|
| 45 |
with open(filepath, encoding="utf-8") as f:
|
| 46 |
+
data = json.load(f)["data"] # Accessing the 'data' field directly
|
| 47 |
+
for id, item in enumerate(data):
|
| 48 |
yield id, {
|
| 49 |
"prompting_type": item["prompting_type"],
|
| 50 |
"deception": item["deception"],
|
|
|
|
| 56 |
"choices": item["choices"],
|
| 57 |
"answer": item["answer"],
|
| 58 |
}
|
|
|
|
| 59 |
# Replace 'MyCustomDataset' with a suitable name that follows Python class naming conventions.
|