umwyf commited on
Commit
4aea9a5
1 Parent(s): 6f6e871

Upload Hi-ToM.py

Browse files

New loading script

Files changed (1) hide show
  1. Hi-ToM.py +2 -3
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["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.