Datasets:

Languages:
English
ArXiv:
License:
SeJinPark commited on
Commit
4c309dc
1 Parent(s): 69c874b

Change split names

Browse files
Files changed (1) hide show
  1. MultiDialog.py +6 -17
MultiDialog.py CHANGED
@@ -122,7 +122,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
122
  if self.config.name == "test_freq":
123
  return [
124
  datasets.SplitGenerator(
125
- name=datasets.Split.TEST,
126
  gen_kwargs={
127
  "audio_archives_iterators": [
128
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["test_freq"]
@@ -137,7 +137,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
137
  if self.config.name == "test_rare":
138
  return [
139
  datasets.SplitGenerator(
140
- name=datasets.Split.TEST,
141
  gen_kwargs={
142
  "audio_archives_iterators": [
143
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["test_rare"]
@@ -152,7 +152,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
152
  if self.config.name == "valid_freq":
153
  return [
154
  datasets.SplitGenerator(
155
- name=datasets.Split.VALIDATION,
156
  gen_kwargs={
157
  "audio_archives_iterators": [
158
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["valid_freq"]
@@ -167,7 +167,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
167
  if self.config.name == "valid_rare":
168
  return [
169
  datasets.SplitGenerator(
170
- name=datasets.Split.VALIDATION,
171
  gen_kwargs={
172
  "audio_archives_iterators": [
173
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["valid_rare"]
@@ -182,7 +182,7 @@ class Multidialog(datasets.GeneratorBasedBuilder):
182
  if self.config.name == "train":
183
  return [
184
  datasets.SplitGenerator(
185
- name=datasets.Split.TRAIN,
186
  gen_kwargs={
187
  "audio_archives_iterators": [
188
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["train"]
@@ -205,10 +205,6 @@ class Multidialog(datasets.GeneratorBasedBuilder):
205
  for line in jsonl_file:
206
  data = json.loads(line.strip())
207
  meta_dict[data["file_name"]] = data
208
- # data = json.loads(line.strip())
209
- # meta_csv = csv.DictReader(csvfile)
210
- # for line in meta_csv:
211
-
212
 
213
  for audio_path_in_archive, audio_file in audio_archive_iterator:
214
  # `audio_path_in_archive` is like "dev_chunks_0000/YOU1000000029_S0000095.wav"
@@ -228,11 +224,4 @@ class Multidialog(datasets.GeneratorBasedBuilder):
228
  yield audio_id, {
229
  "audio": {"path": path , "bytes": audio_file.read()},
230
  **{feature: value for feature, value in audio_meta.items() if feature in self.info.features}
231
- }
232
-
233
-
234
- def _flatten_nested_dict(nested_dict):
235
- return {
236
- key: [inner_list_element for inner_list in value_to_lists.values() for inner_list_element in inner_list]
237
- for key, value_to_lists in nested_dict.items()
238
- }
 
122
  if self.config.name == "test_freq":
123
  return [
124
  datasets.SplitGenerator(
125
+ name="test_freq",
126
  gen_kwargs={
127
  "audio_archives_iterators": [
128
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["test_freq"]
 
137
  if self.config.name == "test_rare":
138
  return [
139
  datasets.SplitGenerator(
140
+ name="test_rare",
141
  gen_kwargs={
142
  "audio_archives_iterators": [
143
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["test_rare"]
 
152
  if self.config.name == "valid_freq":
153
  return [
154
  datasets.SplitGenerator(
155
+ name="valid_freq",
156
  gen_kwargs={
157
  "audio_archives_iterators": [
158
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["valid_freq"]
 
167
  if self.config.name == "valid_rare":
168
  return [
169
  datasets.SplitGenerator(
170
+ name="valid_rare",
171
  gen_kwargs={
172
  "audio_archives_iterators": [
173
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["valid_rare"]
 
182
  if self.config.name == "train":
183
  return [
184
  datasets.SplitGenerator(
185
+ name="train",
186
  gen_kwargs={
187
  "audio_archives_iterators": [
188
  dl_manager.iter_archive(archive_path) for archive_path in audio_archives_paths["train"]
 
205
  for line in jsonl_file:
206
  data = json.loads(line.strip())
207
  meta_dict[data["file_name"]] = data
 
 
 
 
208
 
209
  for audio_path_in_archive, audio_file in audio_archive_iterator:
210
  # `audio_path_in_archive` is like "dev_chunks_0000/YOU1000000029_S0000095.wav"
 
224
  yield audio_id, {
225
  "audio": {"path": path , "bytes": audio_file.read()},
226
  **{feature: value for feature, value in audio_meta.items() if feature in self.info.features}
227
+ }