Changed to using local data.
Browse files- ERRnews.py +8 -16
ERRnews.py
CHANGED
@@ -18,12 +18,12 @@ class ERRNews(datasets.GeneratorBasedBuilder):
|
|
18 |
BUILDER_CONFIGS = [
|
19 |
ERRNewsConfig(
|
20 |
name="sum",
|
21 |
-
data_url="http://bark.phon.ioc.ee/lw/korpused/err_uudised/data.
|
22 |
recordings_url=None
|
23 |
),
|
24 |
ERRNewsConfig(
|
25 |
name="full",
|
26 |
-
data_url="http://bark.phon.ioc.ee/lw/korpused/err_uudised/data.
|
27 |
recordings_url="http://bark.phon.ioc.ee/lw/korpused/err_uudised/recordings.tar"
|
28 |
)
|
29 |
]
|
@@ -76,12 +76,11 @@ class ERRNews(datasets.GeneratorBasedBuilder):
|
|
76 |
|
77 |
def _split_generators(self, dl_manager):
|
78 |
"""Returns SplitGenerators."""
|
79 |
-
train = "
|
80 |
-
test = "
|
81 |
|
82 |
-
|
83 |
-
data_archive =
|
84 |
-
data_files = dl_manager.iter_archive(data)
|
85 |
|
86 |
if self.config.recordings_url:
|
87 |
recordings = dl_manager.download(self.config.recordings_url)
|
@@ -97,7 +96,6 @@ class ERRNews(datasets.GeneratorBasedBuilder):
|
|
97 |
gen_kwargs={
|
98 |
"file_path": train,
|
99 |
"audio_files": audio_files,
|
100 |
-
"data_files": data_files,
|
101 |
"recordings_archive": recordings_archive,
|
102 |
"data_archive": data_archive
|
103 |
},
|
@@ -107,20 +105,14 @@ class ERRNews(datasets.GeneratorBasedBuilder):
|
|
107 |
gen_kwargs={
|
108 |
"file_path": test,
|
109 |
"audio_files": audio_files,
|
110 |
-
"data_files": data_files,
|
111 |
"recordings_archive": recordings_archive,
|
112 |
"data_archive": data_archive
|
113 |
},
|
114 |
),
|
115 |
]
|
116 |
|
117 |
-
def _generate_examples(self, file_path, audio_files,
|
118 |
-
|
119 |
-
data = pd.read_csv(os.path.join(data_archive, file_path))
|
120 |
-
else:
|
121 |
-
for path, f in data_files:
|
122 |
-
if path == file_path:
|
123 |
-
data = pd.read_csv(path)
|
124 |
|
125 |
if audio_files:
|
126 |
for path, f in audio_files:
|
|
|
18 |
BUILDER_CONFIGS = [
|
19 |
ERRNewsConfig(
|
20 |
name="sum",
|
21 |
+
data_url="http://bark.phon.ioc.ee/lw/korpused/err_uudised/data.zip",
|
22 |
recordings_url=None
|
23 |
),
|
24 |
ERRNewsConfig(
|
25 |
name="full",
|
26 |
+
data_url="http://bark.phon.ioc.ee/lw/korpused/err_uudised/data.zip",
|
27 |
recordings_url="http://bark.phon.ioc.ee/lw/korpused/err_uudised/recordings.tar"
|
28 |
)
|
29 |
]
|
|
|
76 |
|
77 |
def _split_generators(self, dl_manager):
|
78 |
"""Returns SplitGenerators."""
|
79 |
+
train = "train.csv"
|
80 |
+
test = "test.csv"
|
81 |
|
82 |
+
#data_archive = dl_manager.download_and_extract(self.config.data_url)
|
83 |
+
data_archive = "./"
|
|
|
84 |
|
85 |
if self.config.recordings_url:
|
86 |
recordings = dl_manager.download(self.config.recordings_url)
|
|
|
96 |
gen_kwargs={
|
97 |
"file_path": train,
|
98 |
"audio_files": audio_files,
|
|
|
99 |
"recordings_archive": recordings_archive,
|
100 |
"data_archive": data_archive
|
101 |
},
|
|
|
105 |
gen_kwargs={
|
106 |
"file_path": test,
|
107 |
"audio_files": audio_files,
|
|
|
108 |
"recordings_archive": recordings_archive,
|
109 |
"data_archive": data_archive
|
110 |
},
|
111 |
),
|
112 |
]
|
113 |
|
114 |
+
def _generate_examples(self, file_path, audio_files, recordings_archive, data_archive):
|
115 |
+
data = pd.read_csv(os.path.join(data_archive, file_path))
|
|
|
|
|
|
|
|
|
|
|
116 |
|
117 |
if audio_files:
|
118 |
for path, f in audio_files:
|