Datasets:
Delete dataset.py
Browse files- dataset.py +0 -30
dataset.py
DELETED
|
@@ -1,30 +0,0 @@
|
|
| 1 |
-
import datasets
|
| 2 |
-
import csv
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
class MyDataset(datasets.GeneratorBasedBuilder):
|
| 6 |
-
def _info(self):
|
| 7 |
-
return datasets.DatasetInfo(
|
| 8 |
-
description="A dataset with audio and phonetic transcriptions.",
|
| 9 |
-
features=datasets.Features({
|
| 10 |
-
"audio": datasets.Audio(sampling_rate=16000),
|
| 11 |
-
"text": datasets.Value("string"),
|
| 12 |
-
}),
|
| 13 |
-
)
|
| 14 |
-
|
| 15 |
-
def _split_generators(self, dl_manager):
|
| 16 |
-
return [
|
| 17 |
-
datasets.SplitGenerator(
|
| 18 |
-
name=datasets.Split.TRAIN,
|
| 19 |
-
gen_kwargs={"csv_path": "data.csv"},
|
| 20 |
-
)
|
| 21 |
-
]
|
| 22 |
-
|
| 23 |
-
def _generate_examples(self, csv_path):
|
| 24 |
-
with open(csv_path, encoding="utf-8") as f:
|
| 25 |
-
reader = csv.DictReader(f)
|
| 26 |
-
for idx, row in enumerate(reader):
|
| 27 |
-
yield idx, {
|
| 28 |
-
"audio": row["audio"],
|
| 29 |
-
"text": row["text"],
|
| 30 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|