Datasets:
medhi-corneille
commited on
Commit
•
b2459f7
1
Parent(s):
a2e8594
Update dataset_dict.py
Browse files- dataset_dict.py +29 -29
dataset_dict.py
CHANGED
@@ -1,29 +1,29 @@
|
|
1 |
-
import datasets
|
2 |
-
|
3 |
-
class LuxembourgPressConferencesGov(datasets.GeneratorBasedBuilder):
|
4 |
-
def _info(self):
|
5 |
-
return datasets.DatasetInfo(
|
6 |
-
features=datasets.Features(
|
7 |
-
{
|
8 |
-
"
|
9 |
-
"transcription": datasets.Value("string"),
|
10 |
-
}
|
11 |
-
),
|
12 |
-
)
|
13 |
-
|
14 |
-
def _split_generators(self, dl_manager):
|
15 |
-
return [
|
16 |
-
datasets.SplitGenerator(
|
17 |
-
name=datasets.Split.TEST,
|
18 |
-
gen_kwargs={"filepath": "metadata.jsonl"},
|
19 |
-
),
|
20 |
-
]
|
21 |
-
|
22 |
-
def _generate_examples(self, filepath):
|
23 |
-
with open(filepath, "r", encoding="utf-8") as f:
|
24 |
-
for idx, line in enumerate(f):
|
25 |
-
data = json.loads(line)
|
26 |
-
yield idx, {
|
27 |
-
"
|
28 |
-
"transcription": data["transcription"],
|
29 |
-
}
|
|
|
1 |
+
import datasets
|
2 |
+
|
3 |
+
class LuxembourgPressConferencesGov(datasets.GeneratorBasedBuilder):
|
4 |
+
def _info(self):
|
5 |
+
return datasets.DatasetInfo(
|
6 |
+
features=datasets.Features(
|
7 |
+
{
|
8 |
+
"file_name": datasets.Audio(sampling_rate=16000),
|
9 |
+
"transcription": datasets.Value("string"),
|
10 |
+
}
|
11 |
+
),
|
12 |
+
)
|
13 |
+
|
14 |
+
def _split_generators(self, dl_manager):
|
15 |
+
return [
|
16 |
+
datasets.SplitGenerator(
|
17 |
+
name=datasets.Split.TEST,
|
18 |
+
gen_kwargs={"filepath": "metadata.jsonl"},
|
19 |
+
),
|
20 |
+
]
|
21 |
+
|
22 |
+
def _generate_examples(self, filepath):
|
23 |
+
with open(filepath, "r", encoding="utf-8") as f:
|
24 |
+
for idx, line in enumerate(f):
|
25 |
+
data = json.loads(line)
|
26 |
+
yield idx, {
|
27 |
+
"file_name": data["file_name"],
|
28 |
+
"transcription": data["transcription"],
|
29 |
+
}
|