HugoLaurencon HF staff commited on
Commit
2543b30
1 Parent(s): 2ebd35a

test without metadata

Browse files
Files changed (1) hide show
  1. libri_light.py +36 -36
libri_light.py CHANGED
@@ -89,38 +89,38 @@ class LibriLight(datasets.GeneratorBasedBuilder):
89
  "file": datasets.Value("string"),
90
  "audio": datasets.Audio(sampling_rate=16_000),
91
  "speaker_id": datasets.Value("int64"),
92
- "metadata": {
93
- "speaker": datasets.Value("string"),
94
- "book_meta": {
95
- "id": datasets.Value("string"),
96
- "title": datasets.Value("string"),
97
- "description": datasets.Value("string"),
98
- "url_text_source": datasets.Value("string"),
99
- "language": datasets.Value("string"),
100
- "copyright_year": datasets.Value("string"),
101
- "num_sections": datasets.Value("string"),
102
- "url_rss": datasets.Value("string"),
103
- "url_zip_file": datasets.Value("string"),
104
- "url_project": datasets.Value("string"),
105
- "url_librivox": datasets.Value("string"),
106
- "url_other": datasets.Value("string"),
107
- "totaltimesecs": datasets.Value("int64"),
108
- "authors": datasets.Sequence(
109
- {
110
- "id": datasets.Value("string"),
111
- "first_name": datasets.Value("string"),
112
- "last_name": datasets.Value("string"),
113
- "dob": datasets.Value("string"),
114
- "dod": datasets.Value("string")
115
- }
116
- ),
117
- "genre": datasets.Sequence(datasets.Value("string")),
118
- "Dramatic Readings": datasets.Value("bool"),
119
- "meta_genre": datasets.Value("string"),
120
- },
121
- "snr": datasets.Value("float32"),
122
- "voice_activity": datasets.Sequence(datasets.Sequence(datasets.Value("float32"))),
123
- }
124
  }
125
  )
126
 
@@ -158,14 +158,14 @@ class LibriLight(datasets.GeneratorBasedBuilder):
158
  file = path if local_extracted_archive else audio_file
159
  audio = {"path": file, "bytes": f.read()}
160
  speaker_id = int(path_split[-3])
161
- path_json = path.replace(".flac", ".json")
162
- with open(path_json) as json_file:
163
- metadata = json.load(json_file)
164
  yield key, {
165
  "id": id_,
166
  "file": file,
167
  "audio": audio,
168
  "speaker_id": speaker_id,
169
- "metadata": metadata,
170
  }
171
  key += 1
 
89
  "file": datasets.Value("string"),
90
  "audio": datasets.Audio(sampling_rate=16_000),
91
  "speaker_id": datasets.Value("int64"),
92
+ #"metadata": {
93
+ # "speaker": datasets.Value("string"),
94
+ # "book_meta": {
95
+ # "id": datasets.Value("string"),
96
+ # "title": datasets.Value("string"),
97
+ # "description": datasets.Value("string"),
98
+ # "url_text_source": datasets.Value("string"),
99
+ # "language": datasets.Value("string"),
100
+ # "copyright_year": datasets.Value("string"),
101
+ # "num_sections": datasets.Value("string"),
102
+ # "url_rss": datasets.Value("string"),
103
+ # "url_zip_file": datasets.Value("string"),
104
+ # "url_project": datasets.Value("string"),
105
+ # "url_librivox": datasets.Value("string"),
106
+ # "url_other": datasets.Value("string"),
107
+ # "totaltimesecs": datasets.Value("int64"),
108
+ # "authors": datasets.Sequence(
109
+ # {
110
+ # "id": datasets.Value("string"),
111
+ # "first_name": datasets.Value("string"),
112
+ # "last_name": datasets.Value("string"),
113
+ # "dob": datasets.Value("string"),
114
+ # "dod": datasets.Value("string")
115
+ # }
116
+ # ),
117
+ # "genre": datasets.Sequence(datasets.Value("string")),
118
+ # "Dramatic Readings": datasets.Value("bool"),
119
+ # "meta_genre": datasets.Value("string"),
120
+ # },
121
+ # "snr": datasets.Value("float32"),
122
+ # "voice_activity": datasets.Sequence(datasets.Sequence(datasets.Value("float32"))),
123
+ #}
124
  }
125
  )
126
 
 
158
  file = path if local_extracted_archive else audio_file
159
  audio = {"path": file, "bytes": f.read()}
160
  speaker_id = int(path_split[-3])
161
+ #path_json = path.replace(".flac", ".json")
162
+ #with open(path_json) as json_file:
163
+ # metadata = json.load(json_file)
164
  yield key, {
165
  "id": id_,
166
  "file": file,
167
  "audio": audio,
168
  "speaker_id": speaker_id,
169
+ # "metadata": metadata,
170
  }
171
  key += 1