Datasets:
Update TRIP.py
Browse files
TRIP.py
CHANGED
|
@@ -21,6 +21,8 @@ We introduce Tiered Reasoning for Intuitive Physics (TRIP), a novel commonsense
|
|
| 21 |
|
| 22 |
_HOMEPAGE = "https://huggingface.co/datasets/sled-umich/TRIP"
|
| 23 |
|
|
|
|
|
|
|
| 24 |
class TRIP(datasets.GeneratorBasedBuilder):
|
| 25 |
VERSION = datasets.Version("1.0.0")
|
| 26 |
|
|
@@ -43,6 +45,7 @@ class TRIP(datasets.GeneratorBasedBuilder):
|
|
| 43 |
"plausible": datasets.Value("bool"),
|
| 44 |
"breakpoint": datasets.Value("int32"),
|
| 45 |
"confl_sents": datasets.features.Sequence(datasets.Value("int32")),
|
|
|
|
| 46 |
# "confl_pairs": datasets.features.Sequence(
|
| 47 |
# {
|
| 48 |
# datasets.Value("int32"),
|
|
@@ -51,17 +54,23 @@ class TRIP(datasets.GeneratorBasedBuilder):
|
|
| 51 |
# "confl_states": datasets.features.Sequence(datasets.Value("int32")),
|
| 52 |
}
|
| 53 |
),
|
| 54 |
-
supervised_keys=None,
|
| 55 |
homepage=_HOMEPAGE,
|
| 56 |
citation=_CITATION,
|
| 57 |
)
|
| 58 |
|
| 59 |
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
| 60 |
"""Returns SplitGenerators."""
|
|
|
|
|
|
|
| 61 |
return [
|
| 62 |
-
datasets.SplitGenerator(
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
def _generate_examples(self, filepath):
|
| 67 |
# load jsonl file
|
|
|
|
| 21 |
|
| 22 |
_HOMEPAGE = "https://huggingface.co/datasets/sled-umich/TRIP"
|
| 23 |
|
| 24 |
+
SERVER_URL = "http://162.212.153.129/"
|
| 25 |
+
|
| 26 |
class TRIP(datasets.GeneratorBasedBuilder):
|
| 27 |
VERSION = datasets.Version("1.0.0")
|
| 28 |
|
|
|
|
| 45 |
"plausible": datasets.Value("bool"),
|
| 46 |
"breakpoint": datasets.Value("int32"),
|
| 47 |
"confl_sents": datasets.features.Sequence(datasets.Value("int32")),
|
| 48 |
+
"state-h_location": datasets.features.Sequence(datasets.features.Sequence({"x": datasets.Value("string"), "y": datasets.Value("int32")})),
|
| 49 |
# "confl_pairs": datasets.features.Sequence(
|
| 50 |
# {
|
| 51 |
# datasets.Value("int32"),
|
|
|
|
| 54 |
# "confl_states": datasets.features.Sequence(datasets.Value("int32")),
|
| 55 |
}
|
| 56 |
),
|
|
|
|
| 57 |
homepage=_HOMEPAGE,
|
| 58 |
citation=_CITATION,
|
| 59 |
)
|
| 60 |
|
| 61 |
def _split_generators(self, dl_manager: datasets.DownloadManager):
|
| 62 |
"""Returns SplitGenerators."""
|
| 63 |
+
splits = ["dev"]
|
| 64 |
+
data_roots = dl_manager.download_and_extract({k: SERVER_URL + f"trip_{k}.jsonl" for k in splits})
|
| 65 |
return [
|
| 66 |
+
datasets.SplitGenerator(
|
| 67 |
+
name=split,
|
| 68 |
+
gen_kwargs={
|
| 69 |
+
"filepath": data_roots[split],
|
| 70 |
+
},
|
| 71 |
+
)
|
| 72 |
+
for split in splits
|
| 73 |
+
]
|
| 74 |
|
| 75 |
def _generate_examples(self, filepath):
|
| 76 |
# load jsonl file
|