Datasets:
update notebook
Browse files- PedroDKE--LibriS2S/__init__.py +0 -1
- PedroDKE--LibriS2S/libris2s.py +0 -79
- config.json +0 -15
- data_example.ipynb +1 -1
- dataset_infos.json +0 -40
PedroDKE--LibriS2S/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
"""LibriS2S dataset."""
|
|
|
|
PedroDKE--LibriS2S/libris2s.py
DELETED
@@ -1,79 +0,0 @@
|
|
1 |
-
"""LibriS2S dataset."""
|
2 |
-
|
3 |
-
import csv
|
4 |
-
import os
|
5 |
-
from typing import Dict, List, Tuple
|
6 |
-
|
7 |
-
import datasets
|
8 |
-
|
9 |
-
|
10 |
-
_CITATION = """@inproceedings{jeuris-niehues-2022-libris2s,
|
11 |
-
title = "{L}ibri{S}2{S}: A {G}erman-{E}nglish Speech-to-Speech Translation Corpus",
|
12 |
-
author = "Jeuris, Pedro and Niehues, Jan",
|
13 |
-
booktitle = "Proceedings of the Thirteenth Language Resources and Evaluation Conference",
|
14 |
-
year = "2022",
|
15 |
-
url = "https://aclanthology.org/2022.lrec-1.98",
|
16 |
-
pages = "928--935"
|
17 |
-
}"""
|
18 |
-
|
19 |
-
_DESCRIPTION = """LibriS2S: A German-English Speech-to-Speech Translation Corpus"""
|
20 |
-
|
21 |
-
_HOMEPAGE = "https://huggingface.co/datasets/PedroDKE/LibriS2S"
|
22 |
-
|
23 |
-
_LICENSE = "cc-by-nc-sa-4.0"
|
24 |
-
|
25 |
-
|
26 |
-
class LibriS2S(datasets.GeneratorBasedBuilder):
|
27 |
-
"""LibriS2S dataset."""
|
28 |
-
|
29 |
-
VERSION = datasets.Version("1.0.0")
|
30 |
-
|
31 |
-
def _info(self) -> datasets.DatasetInfo:
|
32 |
-
return datasets.DatasetInfo(
|
33 |
-
description=_DESCRIPTION,
|
34 |
-
features=datasets.Features(
|
35 |
-
{
|
36 |
-
"book_id": datasets.Value("int64"),
|
37 |
-
"DE_audio": datasets.Audio(),
|
38 |
-
"EN_audio": datasets.Audio(),
|
39 |
-
"score": datasets.Value("float32"),
|
40 |
-
"DE_transcript": datasets.Value("string"),
|
41 |
-
"EN_transcript": datasets.Value("string"),
|
42 |
-
}
|
43 |
-
),
|
44 |
-
homepage=_HOMEPAGE,
|
45 |
-
license=_LICENSE,
|
46 |
-
citation=_CITATION,
|
47 |
-
)
|
48 |
-
|
49 |
-
def _split_generators(self, dl_manager: datasets.DownloadManager) -> List[datasets.SplitGenerator]:
|
50 |
-
"""Returns SplitGenerators."""
|
51 |
-
return [
|
52 |
-
datasets.SplitGenerator(
|
53 |
-
name=datasets.Split.TRAIN,
|
54 |
-
gen_kwargs={
|
55 |
-
"split": "train",
|
56 |
-
"data_dir": ".",
|
57 |
-
},
|
58 |
-
),
|
59 |
-
]
|
60 |
-
|
61 |
-
def _generate_examples(self, split: str, data_dir: str) -> Tuple[int, Dict]:
|
62 |
-
"""Yields examples."""
|
63 |
-
csv_path = os.path.join(data_dir, "alignments", "all_de_en_alligned_cleaned.csv")
|
64 |
-
|
65 |
-
with open(csv_path, encoding="utf-8") as f:
|
66 |
-
reader = csv.DictReader(f)
|
67 |
-
for idx, row in enumerate(reader):
|
68 |
-
# Handle paths for both DE and EN audio
|
69 |
-
de_audio_path = os.path.join(data_dir, row["DE_audio"])
|
70 |
-
en_audio_path = os.path.join(data_dir, row["EN_audio"])
|
71 |
-
|
72 |
-
yield idx, {
|
73 |
-
"book_id": int(row["book_id"]),
|
74 |
-
"DE_audio": de_audio_path,
|
75 |
-
"EN_audio": en_audio_path,
|
76 |
-
"score": float(row["score"]),
|
77 |
-
"DE_transcript": row["DE_transcript"],
|
78 |
-
"EN_transcript": row["EN_transcript"],
|
79 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
config.json
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"version": "1.0.0",
|
3 |
-
"default": {
|
4 |
-
"description": "LibriS2S: A German-English Speech-to-Speech Translation Corpus",
|
5 |
-
"features": {
|
6 |
-
"book_id": "int64",
|
7 |
-
"DE_audio": "audio",
|
8 |
-
"EN_audio": "audio",
|
9 |
-
"score": "float32",
|
10 |
-
"DE_transcript": "string",
|
11 |
-
"EN_transcript": "string"
|
12 |
-
},
|
13 |
-
"splits": ["train"]
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data_example.ipynb
CHANGED
@@ -7,7 +7,7 @@
|
|
7 |
"outputs": [],
|
8 |
"source": [
|
9 |
"import pandas as pd\n",
|
10 |
-
"from
|
11 |
]
|
12 |
},
|
13 |
{
|
|
|
7 |
"outputs": [],
|
8 |
"source": [
|
9 |
"import pandas as pd\n",
|
10 |
+
"from libris2s_dataset_pt import Libris2sDataset"
|
11 |
]
|
12 |
},
|
13 |
{
|
dataset_infos.json
DELETED
@@ -1,40 +0,0 @@
|
|
1 |
-
{
|
2 |
-
"default": {
|
3 |
-
"description": "LibriS2S: A German-English Speech-to-Speech Translation Corpus",
|
4 |
-
"citation": "@inproceedings{jeuris-niehues-2022-libris2s,\n title = \"{L}ibri{S}2{S}: A {G}erman-{E}nglish Speech-to-Speech Translation Corpus\",\n author = \"Jeuris, Pedro and Niehues, Jan\",\n booktitle = \"Proceedings of the Thirteenth Language Resources and Evaluation Conference\",\n year = \"2022\",\n url = \"https://aclanthology.org/2022.lrec-1.98\",\n pages = \"928--935\"\n}",
|
5 |
-
"homepage": "https://huggingface.co/datasets/PedroDKE/LibriS2S",
|
6 |
-
"license": "cc-by-nc-sa-4.0",
|
7 |
-
"features": {
|
8 |
-
"book_id": {
|
9 |
-
"dtype": "int64",
|
10 |
-
"_type": "Value"
|
11 |
-
},
|
12 |
-
"DE_audio": {
|
13 |
-
"_type": "Audio"
|
14 |
-
},
|
15 |
-
"EN_audio": {
|
16 |
-
"_type": "Audio"
|
17 |
-
},
|
18 |
-
"score": {
|
19 |
-
"dtype": "float32",
|
20 |
-
"_type": "Value"
|
21 |
-
},
|
22 |
-
"DE_transcript": {
|
23 |
-
"dtype": "string",
|
24 |
-
"_type": "Value"
|
25 |
-
},
|
26 |
-
"EN_transcript": {
|
27 |
-
"dtype": "string",
|
28 |
-
"_type": "Value"
|
29 |
-
}
|
30 |
-
},
|
31 |
-
"splits": {
|
32 |
-
"train": {
|
33 |
-
"name": "train",
|
34 |
-
"num_bytes": 10069085,
|
35 |
-
"num_examples": 25604,
|
36 |
-
"dataset_name": "LibriS2S"
|
37 |
-
}
|
38 |
-
}
|
39 |
-
}
|
40 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|