Update ldkp10k.py
Browse files- ldkp10k.py +8 -8
ldkp10k.py
CHANGED
@@ -24,9 +24,9 @@ _LICENSE = ""
|
|
24 |
# TODO: Add link to the official dataset URLs here
|
25 |
|
26 |
_URLS = {
|
27 |
-
"test": "data/test.jsonl",
|
28 |
"train": "data/train",
|
29 |
-
"valid": "data/valid.jsonl",
|
30 |
|
31 |
}
|
32 |
|
@@ -48,8 +48,9 @@ class LDKP10k(datasets.GeneratorBasedBuilder):
|
|
48 |
DEFAULT_CONFIG_NAME = "small"
|
49 |
|
50 |
def _info(self):
|
51 |
-
|
52 |
-
|
|
|
53 |
|
54 |
features = datasets.Features(
|
55 |
{
|
@@ -77,13 +78,12 @@ class LDKP10k(datasets.GeneratorBasedBuilder):
|
|
77 |
def _split_generators(self, dl_manager):
|
78 |
#print(os.listdir())
|
79 |
data_dir = dl_manager.download_and_extract(_URLS)
|
80 |
-
|
81 |
return [
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TRAIN,
|
84 |
# These kwargs will be passed to _generate_examples
|
85 |
gen_kwargs={
|
86 |
-
"
|
87 |
"split": "train",
|
88 |
},
|
89 |
),
|
@@ -91,7 +91,7 @@ class LDKP10k(datasets.GeneratorBasedBuilder):
|
|
91 |
name=datasets.Split.TEST,
|
92 |
# These kwargs will be passed to _generate_examples
|
93 |
gen_kwargs={
|
94 |
-
"
|
95 |
"split": "test"
|
96 |
},
|
97 |
),
|
@@ -99,7 +99,7 @@ class LDKP10k(datasets.GeneratorBasedBuilder):
|
|
99 |
name=datasets.Split.VALIDATION,
|
100 |
# These kwargs will be passed to _generate_examples
|
101 |
gen_kwargs={
|
102 |
-
"
|
103 |
"split": "valid",
|
104 |
},
|
105 |
),
|
|
|
24 |
# TODO: Add link to the official dataset URLs here
|
25 |
|
26 |
_URLS = {
|
27 |
+
"test": ["data/test.jsonl"],
|
28 |
"train": "data/train",
|
29 |
+
"valid": ["data/valid.jsonl"],
|
30 |
|
31 |
}
|
32 |
|
|
|
48 |
DEFAULT_CONFIG_NAME = "small"
|
49 |
|
50 |
def _info(self):
|
51 |
+
_URLS['train']=['data/train'+"_"+self.config.name+".jsonl.zip"]
|
52 |
+
if self.config.name=='large':
|
53 |
+
_URLS['train']= ['data/train_large_'+str(x)+".jsonl.zip" for x in range(5)]
|
54 |
|
55 |
features = datasets.Features(
|
56 |
{
|
|
|
78 |
def _split_generators(self, dl_manager):
|
79 |
#print(os.listdir())
|
80 |
data_dir = dl_manager.download_and_extract(_URLS)
|
|
|
81 |
return [
|
82 |
datasets.SplitGenerator(
|
83 |
name=datasets.Split.TRAIN,
|
84 |
# These kwargs will be passed to _generate_examples
|
85 |
gen_kwargs={
|
86 |
+
"filepaths": [os.path.join(x,filename) for x in data_dir['train'] for filename in os.listdir(x)],
|
87 |
"split": "train",
|
88 |
},
|
89 |
),
|
|
|
91 |
name=datasets.Split.TEST,
|
92 |
# These kwargs will be passed to _generate_examples
|
93 |
gen_kwargs={
|
94 |
+
"filepaths": data_dir['test'],
|
95 |
"split": "test"
|
96 |
},
|
97 |
),
|
|
|
99 |
name=datasets.Split.VALIDATION,
|
100 |
# These kwargs will be passed to _generate_examples
|
101 |
gen_kwargs={
|
102 |
+
"filepaths": data_dir['valid'],
|
103 |
"split": "valid",
|
104 |
},
|
105 |
),
|