Datasets:
config changes
Browse files- NPSC_orto.py +25 -23
NPSC_orto.py
CHANGED
|
@@ -14,7 +14,7 @@
|
|
| 14 |
# limitations under the License.
|
| 15 |
|
| 16 |
# Lint as: python3
|
| 17 |
-
"""
|
| 18 |
|
| 19 |
import io
|
| 20 |
import json
|
|
@@ -39,14 +39,16 @@ The Norwegian Parliament Speech Corpus (NPSC) is a corpus for training a Norwegi
|
|
| 39 |
NPSC is based on sound recording from meeting in the Norwegian Parliament. These talks are orthographically transcribed to either Norwegian Bokmål or Norwegian Nynorsk. In addition to the data actually included in this dataset, there is a significant amount of metadata that is included in the original corpus. Through the speaker id there is additional information about the speaker, like gender, age, and place of birth (ie dialect). Through the proceedings id the corpus can be linked to the official proceedings from the meetings.
|
| 40 |
|
| 41 |
The corpus is in total sound recordings from 40 entire days of meetings. This amounts to 140 hours of speech, 65,000 sentences or 1.2 million words.
|
|
|
|
|
|
|
| 42 |
"""
|
| 43 |
|
| 44 |
_HOMEPAGE = "https://www.nb.no/sprakbanken/en/resource-catalogue/oai-nb-no-sbr-58/"
|
| 45 |
|
| 46 |
-
# Example: https://huggingface.co/datasets/NbAiLab/
|
| 47 |
-
_DATA_URL = "https://huggingface.co/datasets/NbAiLab/
|
| 48 |
-
# Example: https://huggingface.co/datasets/NbAiLab/
|
| 49 |
-
_METADATA_URL = "https://huggingface.co/datasets/NbAiLab/
|
| 50 |
|
| 51 |
_SHARDS = {
|
| 52 |
"eval": ["20170209", "20180109", "20180201", "20180307", "20180611"],
|
|
@@ -55,52 +57,52 @@ _SHARDS = {
|
|
| 55 |
}
|
| 56 |
|
| 57 |
|
| 58 |
-
class
|
| 59 |
-
"""BuilderConfig for
|
| 60 |
|
| 61 |
def __init__(self, *args, **kwargs):
|
| 62 |
-
"""BuilderConfig for
|
| 63 |
|
| 64 |
Args:
|
| 65 |
**kwargs: keyword arguments forwarded to super.
|
| 66 |
"""
|
| 67 |
-
super(
|
| 68 |
|
| 69 |
|
| 70 |
-
class
|
| 71 |
-
"""
|
| 72 |
|
| 73 |
DEFAULT_WRITER_BATCH_SIZE = 1000
|
| 74 |
BUILDER_CONFIGS = [
|
| 75 |
-
|
| 76 |
name="48K_mp3",
|
| 77 |
version=datasets.Version("1.0.0"),
|
| 78 |
-
description="
|
| 79 |
),
|
| 80 |
-
|
| 81 |
name="16K_mp3",
|
| 82 |
version=datasets.Version("1.0.0"),
|
| 83 |
-
description="
|
| 84 |
),
|
| 85 |
-
|
| 86 |
name="48K_mp3_bokmaal",
|
| 87 |
version=datasets.Version("1.0.0"),
|
| 88 |
-
description="
|
| 89 |
),
|
| 90 |
-
|
| 91 |
name="16K_mp3_bokmaal",
|
| 92 |
version=datasets.Version("1.0.0"),
|
| 93 |
-
description="
|
| 94 |
),
|
| 95 |
-
|
| 96 |
name="48K_mp3_nynorsk",
|
| 97 |
version=datasets.Version("1.0.0"),
|
| 98 |
-
description="
|
| 99 |
),
|
| 100 |
-
|
| 101 |
name="16K_mp3_nynorsk",
|
| 102 |
version=datasets.Version("1.0.0"),
|
| 103 |
-
description="
|
| 104 |
),
|
| 105 |
]
|
| 106 |
|
|
|
|
| 14 |
# limitations under the License.
|
| 15 |
|
| 16 |
# Lint as: python3
|
| 17 |
+
"""NPSC_orto: Norwegian Parliament Speech Corpus"""
|
| 18 |
|
| 19 |
import io
|
| 20 |
import json
|
|
|
|
| 39 |
NPSC is based on sound recording from meeting in the Norwegian Parliament. These talks are orthographically transcribed to either Norwegian Bokmål or Norwegian Nynorsk. In addition to the data actually included in this dataset, there is a significant amount of metadata that is included in the original corpus. Through the speaker id there is additional information about the speaker, like gender, age, and place of birth (ie dialect). Through the proceedings id the corpus can be linked to the official proceedings from the meetings.
|
| 40 |
|
| 41 |
The corpus is in total sound recordings from 40 entire days of meetings. This amounts to 140 hours of speech, 65,000 sentences or 1.2 million words.
|
| 42 |
+
|
| 43 |
+
This dataset builds on this corpus. In addition it adds two columns with machine generated orthographic text.
|
| 44 |
"""
|
| 45 |
|
| 46 |
_HOMEPAGE = "https://www.nb.no/sprakbanken/en/resource-catalogue/oai-nb-no-sbr-58/"
|
| 47 |
|
| 48 |
+
# Example: https://huggingface.co/datasets/NbAiLab/NPSC_orto/resolve/main/data/train/20170110_48K_mp3.tar.gz
|
| 49 |
+
_DATA_URL = "https://huggingface.co/datasets/NbAiLab/NPSC_orto/resolve/main/data/{split}/{shard}_{config}.tar.gz"
|
| 50 |
+
# Example: https://huggingface.co/datasets/NbAiLab/NPSC_orto/resolve/main/data/test/20170207.json
|
| 51 |
+
_METADATA_URL = "https://huggingface.co/datasets/NbAiLab/NPSC_orto/resolve/main/data/{split}/{shard}.json"
|
| 52 |
|
| 53 |
_SHARDS = {
|
| 54 |
"eval": ["20170209", "20180109", "20180201", "20180307", "20180611"],
|
|
|
|
| 57 |
}
|
| 58 |
|
| 59 |
|
| 60 |
+
class Npsc_ortoConfig(datasets.BuilderConfig):
|
| 61 |
+
"""BuilderConfig for NPSC_orto."""
|
| 62 |
|
| 63 |
def __init__(self, *args, **kwargs):
|
| 64 |
+
"""BuilderConfig for NPSC_orto.
|
| 65 |
|
| 66 |
Args:
|
| 67 |
**kwargs: keyword arguments forwarded to super.
|
| 68 |
"""
|
| 69 |
+
super(Npsc_ortoConfig, self).__init__(*args, **kwargs)
|
| 70 |
|
| 71 |
|
| 72 |
+
class Npsc_orto(datasets.GeneratorBasedBuilder):
|
| 73 |
+
"""NPSC_orto dataset."""
|
| 74 |
|
| 75 |
DEFAULT_WRITER_BATCH_SIZE = 1000
|
| 76 |
BUILDER_CONFIGS = [
|
| 77 |
+
Npsc_ortoConfig(
|
| 78 |
name="48K_mp3",
|
| 79 |
version=datasets.Version("1.0.0"),
|
| 80 |
+
description="NPSC_orto with samples in 48KHz stereo mp3)",
|
| 81 |
),
|
| 82 |
+
Npsc_ortoConfig(
|
| 83 |
name="16K_mp3",
|
| 84 |
version=datasets.Version("1.0.0"),
|
| 85 |
+
description="NPSC_orto with samples in 16KHz mono mp3)",
|
| 86 |
),
|
| 87 |
+
Npsc_ortoConfig(
|
| 88 |
name="48K_mp3_bokmaal",
|
| 89 |
version=datasets.Version("1.0.0"),
|
| 90 |
+
description="NPSCi_orto with Bokmål samples in 48KHz stereo mp3)",
|
| 91 |
),
|
| 92 |
+
Npsc_ortoConfig(
|
| 93 |
name="16K_mp3_bokmaal",
|
| 94 |
version=datasets.Version("1.0.0"),
|
| 95 |
+
description="NPSC_orto with Bokmål samples in 16KHz mono mp3)",
|
| 96 |
),
|
| 97 |
+
Nps_ortocConfig(
|
| 98 |
name="48K_mp3_nynorsk",
|
| 99 |
version=datasets.Version("1.0.0"),
|
| 100 |
+
description="NPSCi_orto with Nynorsk samples in 48KHz stereo mp3)",
|
| 101 |
),
|
| 102 |
+
Npsc_ortoConfig(
|
| 103 |
name="16K_mp3_nynorsk",
|
| 104 |
version=datasets.Version("1.0.0"),
|
| 105 |
+
description="NPSC_orto with Nynorsk samples in 16KHz mono mp3)",
|
| 106 |
),
|
| 107 |
]
|
| 108 |
|