Commit
·
7e54614
1
Parent(s):
3f91671
changing way to work with zip in Scifi_TV_Shows.py
Browse files- Scifi_TV_Shows.py +9 -13
Scifi_TV_Shows.py
CHANGED
@@ -71,38 +71,34 @@ class Scifi_TV_Shows(datasets.GeneratorBasedBuilder):
|
|
71 |
|
72 |
def _split_generators(self, dl_manager):
|
73 |
my_urls = _URLS[self.config.name]
|
74 |
-
|
|
|
|
|
|
|
|
|
75 |
return[
|
76 |
datasets.SplitGenerator(
|
77 |
name=datasets.Split.TRAIN,
|
78 |
gen_kwargs={
|
79 |
-
'filepath':
|
80 |
-
"split": "train",
|
81 |
-
"files": dl_manager.iter_archive(archive),
|
82 |
},
|
83 |
),
|
84 |
datasets.SplitGenerator(
|
85 |
name=datasets.Split.TEST,
|
86 |
gen_kwargs={
|
87 |
-
'filepath':
|
88 |
-
"split": "test",
|
89 |
-
"files": dl_manager.iter_archive(archive),
|
90 |
},
|
91 |
),
|
92 |
datasets.SplitGenerator(
|
93 |
name=datasets.Split.VALIDATION,
|
94 |
gen_kwargs={
|
95 |
-
'filepath':
|
96 |
-
"split": "val",
|
97 |
-
"files": dl_manager.iter_archive(archive),
|
98 |
},
|
99 |
),
|
100 |
datasets.SplitGenerator(
|
101 |
name="all",
|
102 |
gen_kwargs={
|
103 |
-
'filepath':
|
104 |
-
"split": "all",
|
105 |
-
"files": dl_manager.iter_archive(archive),
|
106 |
},
|
107 |
),
|
108 |
]
|
|
|
71 |
|
72 |
def _split_generators(self, dl_manager):
|
73 |
my_urls = _URLS[self.config.name]
|
74 |
+
data_dir = dl_manager.download_and_extract(my_urls)
|
75 |
+
train_filepath = os.path.join(data_dir, "all-sci-fi-data-train.txt")
|
76 |
+
test_filepath = os.path.join(data_dir, "all-sci-fi-data-test.txt")
|
77 |
+
val_filepath = os.path.join(data_dir, "all-sci-fi-data-val.txt")
|
78 |
+
all_filepath = os.path.join(data_dir, "all-sci-fi-data.txt")
|
79 |
return[
|
80 |
datasets.SplitGenerator(
|
81 |
name=datasets.Split.TRAIN,
|
82 |
gen_kwargs={
|
83 |
+
'filepath': train_filepath,
|
|
|
|
|
84 |
},
|
85 |
),
|
86 |
datasets.SplitGenerator(
|
87 |
name=datasets.Split.TEST,
|
88 |
gen_kwargs={
|
89 |
+
'filepath': test_filepath,
|
|
|
|
|
90 |
},
|
91 |
),
|
92 |
datasets.SplitGenerator(
|
93 |
name=datasets.Split.VALIDATION,
|
94 |
gen_kwargs={
|
95 |
+
'filepath': val_filepath,
|
|
|
|
|
96 |
},
|
97 |
),
|
98 |
datasets.SplitGenerator(
|
99 |
name="all",
|
100 |
gen_kwargs={
|
101 |
+
'filepath': all_filepath,
|
|
|
|
|
102 |
},
|
103 |
),
|
104 |
]
|