Datasets:

Modalities:
Audio
Text
Formats:
parquet
Libraries:
Datasets
Dask
License:
BenjaminGalliot commited on
Commit
2c516be
1 Parent(s): 21ffce1
Files changed (1) hide show
  1. pangloss.py +15 -16
pangloss.py CHANGED
@@ -17,7 +17,6 @@ import csv
17
  import json
18
  import os
19
  import datasets
20
- from datasets.tasks import AutomaticSpeechRecognition
21
 
22
  _CITATION = {
23
  "yong1288": """
@@ -53,19 +52,13 @@ url = {https://doi.org/10.5281/zenodo.5521112}
53
  }
54
 
55
  _DESCRIPTION = """\
56
- These datasets are extracts from the Pangloss collection and have
57
- been preprocessed for ASR experiments in Na and Japhug.
58
  """
59
 
60
  _HOMEPAGE = "https://pangloss.cnrs.fr/"
61
 
62
  _LICENSE = "https://creativecommons.org/licenses/by-nc-sa/4.0/fr/legalcode"
63
 
64
- # The HuggingFace Datasets library doesn't host the datasets but only points to the original files.
65
- # This can be an arbitrary nested dict/list of URLs (see below in `_split_generators` method)
66
-
67
- _VERSION = datasets.Version("1.0.0")
68
-
69
  _LANGUAGES = {
70
  "yong1288": {
71
  "url": "https://mycore.core-cloud.net/index.php/s/vaGMeRf4Iij8MWR/download",
@@ -93,6 +86,14 @@ class PanglossDataset(datasets.GeneratorBasedBuilder):
93
  "traduction:zh": "translation:zh"
94
  }
95
 
 
 
 
 
 
 
 
 
96
  # This is an example of a dataset with multiple configurations.
97
  # If you don't want/need to define several sub-sets in your dataset,
98
  # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
@@ -105,24 +106,24 @@ class PanglossDataset(datasets.GeneratorBasedBuilder):
105
  # data = datasets.load_dataset('my_dataset', 'first_domain')
106
  # data = datasets.load_dataset('my_dataset', 'second_domain')
107
  BUILDER_CONFIGS = [
108
- datasets.BuilderConfig(name=language_name, version=_VERSION, description=language_data["description"])
109
  for language_name, language_data in _LANGUAGES.items()
110
  ]
111
 
112
- #DEFAULT_CONFIG_NAME = "na" # It's not mandatory to have a default configuration. Just use one if it make sense.
113
 
114
  def _info(self):
115
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
116
  features = datasets.Features(
117
  {
118
  "path": datasets.Value("string"),
119
- "audio": datasets.features.Audio(sampling_rate=16_000),
120
  "sentence": datasets.Value("string"),
121
  "doctype": datasets.Value("string"),
 
122
  **{f"translation:{language_code}": datasets.Value("string") for language_code in _LANGUAGES[self.config.name]["translations"]}
123
  }
124
  )
125
-
126
  return datasets.DatasetInfo(
127
  # This is the description that will appear on the datasets page.
128
  description=_DESCRIPTION,
@@ -137,8 +138,6 @@ class PanglossDataset(datasets.GeneratorBasedBuilder):
137
  license=_LICENSE,
138
  # Citation for the dataset
139
  citation=_CITATION,
140
- task_templates=[AutomaticSpeechRecognition(audio_column="audio", transcription_column="forme")],
141
-
142
  )
143
 
144
  def _split_generators(self, dl_manager):
@@ -191,9 +190,9 @@ class PanglossDataset(datasets.GeneratorBasedBuilder):
191
  yield key, data
192
 
193
 
194
- if __name__ == "__main__":
195
  # for language in _LANGUAGES.keys():
196
- datasets.load_dataset("pangloss.py", "japh1234")
197
 
198
  # datasets-cli test datasets/pangloss --save_infos --all_configs
199
  # datasets-cli dummy_data datasets/pangloss --auto_generate
 
17
  import json
18
  import os
19
  import datasets
 
20
 
21
  _CITATION = {
22
  "yong1288": """
 
52
  }
53
 
54
  _DESCRIPTION = """\
55
+ These datasets are extracts from the Pangloss collection and have been preprocessed for ASR experiments in Yongning Na and Japhug.
 
56
  """
57
 
58
  _HOMEPAGE = "https://pangloss.cnrs.fr/"
59
 
60
  _LICENSE = "https://creativecommons.org/licenses/by-nc-sa/4.0/fr/legalcode"
61
 
 
 
 
 
 
62
  _LANGUAGES = {
63
  "yong1288": {
64
  "url": "https://mycore.core-cloud.net/index.php/s/vaGMeRf4Iij8MWR/download",
 
86
  "traduction:zh": "translation:zh"
87
  }
88
 
89
+ VERSION = datasets.Version("1.2.0")
90
+
91
+ # TODO: Name of the dataset usually matches the script name with CamelCase instead of snake_case
92
+ class NewDataset(datasets.GeneratorBasedBuilder):
93
+ """TODO: Short description of my dataset."""
94
+
95
+
96
+
97
  # This is an example of a dataset with multiple configurations.
98
  # If you don't want/need to define several sub-sets in your dataset,
99
  # just remove the BUILDER_CONFIG_CLASS and the BUILDER_CONFIGS attributes.
 
106
  # data = datasets.load_dataset('my_dataset', 'first_domain')
107
  # data = datasets.load_dataset('my_dataset', 'second_domain')
108
  BUILDER_CONFIGS = [
109
+ datasets.BuilderConfig(name=language_name, version=VERSION, description=language_data["description"])
110
  for language_name, language_data in _LANGUAGES.items()
111
  ]
112
 
113
+ #DEFAULT_CONFIG_NAME = "" # It's not mandatory to have a default configuration. Just use one if it make sense.
114
 
115
  def _info(self):
116
  # TODO: This method specifies the datasets.DatasetInfo object which contains informations and typings for the dataset
117
  features = datasets.Features(
118
  {
119
  "path": datasets.Value("string"),
120
+ "audio": datasets.Audio(sampling_rate=16_000),
121
  "sentence": datasets.Value("string"),
122
  "doctype": datasets.Value("string"),
123
+ "speaker": datasets.Value("string"),
124
  **{f"translation:{language_code}": datasets.Value("string") for language_code in _LANGUAGES[self.config.name]["translations"]}
125
  }
126
  )
 
127
  return datasets.DatasetInfo(
128
  # This is the description that will appear on the datasets page.
129
  description=_DESCRIPTION,
 
138
  license=_LICENSE,
139
  # Citation for the dataset
140
  citation=_CITATION,
 
 
141
  )
142
 
143
  def _split_generators(self, dl_manager):
 
190
  yield key, data
191
 
192
 
193
+ # if __name__ == "__main__":
194
  # for language in _LANGUAGES.keys():
195
+ # datasets.load_dataset("datasets/pangloss/pangloss.py", "japh1234")
196
 
197
  # datasets-cli test datasets/pangloss --save_infos --all_configs
198
  # datasets-cli dummy_data datasets/pangloss --auto_generate