Upload Hi-ToM.py
Browse filesNew Loading Script
Hi-ToM.py
CHANGED
@@ -1,10 +1,14 @@
|
|
|
|
1 |
from datasets import DatasetBuilder, DatasetInfo, SplitGenerators, DownloadManager
|
2 |
-
from datasets.features import Features,
|
|
|
3 |
|
4 |
class MyCustomDataset(DatasetBuilder):
|
5 |
VERSION = datasets.Version("1.0.0")
|
6 |
|
7 |
def _info(self):
|
|
|
|
|
8 |
return DatasetInfo(
|
9 |
description="My custom dataset for tracking objects.",
|
10 |
features=Features({
|
@@ -20,12 +24,12 @@ class MyCustomDataset(DatasetBuilder):
|
|
20 |
}),
|
21 |
supervised_keys=None,
|
22 |
homepage="https://github.com/ying-hui-he/Hi-ToM_dataset",
|
23 |
-
citation=CITATION,
|
24 |
)
|
25 |
|
26 |
def _split_generators(self, dl_manager: DownloadManager):
|
|
|
27 |
downloaded_files = dl_manager.download_and_extract({
|
28 |
-
"data_file": "https://
|
29 |
})
|
30 |
|
31 |
return [
|
@@ -52,3 +56,5 @@ class MyCustomDataset(DatasetBuilder):
|
|
52 |
"choices": item["choices"],
|
53 |
"answer": item["answer"],
|
54 |
}
|
|
|
|
|
|
1 |
+
import json
|
2 |
from datasets import DatasetBuilder, DatasetInfo, SplitGenerators, DownloadManager
|
3 |
+
from datasets.features import Features, Value
|
4 |
+
import datasets
|
5 |
|
6 |
class MyCustomDataset(DatasetBuilder):
|
7 |
VERSION = datasets.Version("1.0.0")
|
8 |
|
9 |
def _info(self):
|
10 |
+
# Ensure CITATION is a string containing the bibliographic citation for your dataset
|
11 |
+
|
12 |
return DatasetInfo(
|
13 |
description="My custom dataset for tracking objects.",
|
14 |
features=Features({
|
|
|
24 |
}),
|
25 |
supervised_keys=None,
|
26 |
homepage="https://github.com/ying-hui-he/Hi-ToM_dataset",
|
|
|
27 |
)
|
28 |
|
29 |
def _split_generators(self, dl_manager: DownloadManager):
|
30 |
+
# Using the raw content URL for GitHub
|
31 |
downloaded_files = dl_manager.download_and_extract({
|
32 |
+
"data_file": "https://raw.githubusercontent.com/ying-hui-he/Hi-ToM_dataset/main/Hi-ToM_data.json"
|
33 |
})
|
34 |
|
35 |
return [
|
|
|
56 |
"choices": item["choices"],
|
57 |
"answer": item["answer"],
|
58 |
}
|
59 |
+
|
60 |
+
# Replace 'MyCustomDataset' with a suitable name that follows Python class naming conventions.
|