Lennart Keller commited on
Commit
6e5383a
1 Parent(s): e5b16aa
Files changed (4) hide show
  1. SpeechTaxi.py +13 -9
  2. create_release.py +25 -9
  3. data.zip +2 -2
  4. tables.zip +2 -2
SpeechTaxi.py CHANGED
@@ -15,9 +15,7 @@ NAMES = [
15
  "bgc",
16
  "bht",
17
  "ckb",
18
- "eng",
19
  "ewe",
20
- "fra",
21
  "guj",
22
  "ibo",
23
  "kan",
@@ -30,7 +28,6 @@ NAMES = [
30
  "nlx",
31
  "pan",
32
  "peg",
33
- "rus",
34
  "tam",
35
  "tel",
36
  "tw-akuapem",
@@ -42,9 +39,17 @@ NAMES = [
42
 
43
  ]
44
 
45
- DESCRIPTION = ""
46
- CITATION = "TODO"
47
- HOMPAGE = "github.com/LennartKeller"
 
 
 
 
 
 
 
 
48
 
49
  class SpeechTaxiConfig(datasets.BuilderConfig):
50
  def __init__(
@@ -88,9 +93,8 @@ class SpeechTaxi(datasets.GeneratorBasedBuilder):
88
  ]
89
  ),
90
  "audio": datasets.features.Audio(sampling_rate=16_000),
91
- "transription_mms-zeroshot-300m": datasets.features.Value("string"),
92
- "transription_mms": datasets.features.Value("string"),
93
- "transription_whisper-large-v3": datasets.features.Value("string"),
94
  }
95
  ),
96
  supervised_keys=None,
 
15
  "bgc",
16
  "bht",
17
  "ckb",
 
18
  "ewe",
 
19
  "guj",
20
  "ibo",
21
  "kan",
 
28
  "nlx",
29
  "pan",
30
  "peg",
 
31
  "tam",
32
  "tel",
33
  "tw-akuapem",
 
39
 
40
  ]
41
 
42
+ DESCRIPTION = """"""
43
+ CITATION = """@misc{keller2024speechtaximultilingualsemanticspeech,
44
+ title={SpeechTaxi: On Multilingual Semantic Speech Classification},
45
+ author={Lennart Keller and Goran Glavaš},
46
+ year={2024},
47
+ eprint={2409.06372},
48
+ archivePrefix={arXiv},
49
+ primaryClass={cs.CL},
50
+ url={https://arxiv.org/abs/2409.06372},
51
+ }"""
52
+ HOMPAGE = "https://huggingface.co/datasets/LennartKeller/SpeechTaxi"
53
 
54
  class SpeechTaxiConfig(datasets.BuilderConfig):
55
  def __init__(
 
93
  ]
94
  ),
95
  "audio": datasets.features.Audio(sampling_rate=16_000),
96
+ "transcription_mms-zeroshot-300m": datasets.features.Value("string"),
97
+ "transcription_whisper-large-v3": datasets.features.Value("string"),
 
98
  }
99
  ),
100
  supervised_keys=None,
create_release.py CHANGED
@@ -16,8 +16,18 @@ from tqdm.auto import tqdm
16
  NAME = "SpeechTaxi"
17
  VERSION = "0.0.1"
18
  HOMEPAGE = "github.com/LennartKeller"
19
- CITATION = "TODO"
20
- DESCRIPTION = "TODO"
 
 
 
 
 
 
 
 
 
 
21
  SAVE_DIR = Path("/hdd/lennart/datasets")
22
 
23
  # Define some arguments and 'constants'
@@ -28,11 +38,13 @@ REWRITE_PATHS = (
28
  )
29
  REWRITE_MASS_PATHS = ("/Volumes/SanDiskData/", "/hdd/lennart/")
30
  ALIGNED_TABLES_DIR = Path("aligned_tables")
31
- INCLUDE_MASS_LANGUAGES = True
32
  MASS_LANGUAGES = ("eng", "rus", "spa", "ron", "eus", "fra")
33
  SKIP_LANGUAGES = ("ron", "eus", "spa", "hau", "bdv", "nep", "ben")
34
  SCRIPT_TEMPLATE = Path("SpeechTaxi.py.jinja")
35
 
 
 
36
 
37
  def rewrite_path(p: str | Path) -> str | Path:
38
  if REWRITE_PATHS:
@@ -213,7 +225,7 @@ def read_mass_instance(audio_file: str | Path) -> dict:
213
  key = machine_generated_transcription_file.stem.split("_one_channel-")[-1]
214
  key = key.removesuffix("-transcript")
215
  # print(audio_file, "|", machine_generated_transcription_file, "|", key)
216
- machine_generated_transcriptions[f"transription_{key}"] = (
217
  machine_generated_transcription_file.read_text()
218
  )
219
  data = {
@@ -266,8 +278,10 @@ def read_bible_scrape_instance(audio_file: str | Path) -> dict:
266
  .removesuffix("-transcript")
267
  .strip("-")
268
  )
 
 
269
  # print(audio_file, "|", machine_generated_transcription_file, "|", key)
270
- machine_generated_transcriptions[f"transription_{key}"] = (
271
  machine_generated_transcription_file.read_text()
272
  )
273
 
@@ -344,7 +358,7 @@ if __name__ == "__main__":
344
  except Exception as e:
345
  print("Error reading file", audio_file)
346
  print(e)
347
- print("_"*30)
348
  continue
349
  # Files that can't be read have zero alignment scores anyways so in most cases this isn't an issue
350
  data = (
@@ -366,7 +380,7 @@ if __name__ == "__main__":
366
  except Exception as e:
367
  print("Error reading file", audio_file)
368
  print(e)
369
- print("_"*30)
370
  continue
371
  # Files that can't be read have zero alignment scores anyways so in most cases this isn't an issue
372
  data = data | {
@@ -376,8 +390,10 @@ if __name__ == "__main__":
376
  "audio": copied_audio_file.relative_to(data_dir).as_posix(),
377
  }
378
  final_table_data.append(data)
379
- pbar.set_description(f"{str(alignment_table)} | Total invalid: {invalid_counter}")
380
-
 
 
381
  final_table = pd.DataFrame.from_records(final_table_data)
382
  final_table.to_csv(table_dir / alignment_table.name, index=False, sep="\t")
383
 
 
16
  NAME = "SpeechTaxi"
17
  VERSION = "0.0.1"
18
  HOMEPAGE = "github.com/LennartKeller"
19
+ CITATION = """
20
+ @misc{keller2024speechtaximultilingualsemanticspeech,
21
+ title={SpeechTaxi: On Multilingual Semantic Speech Classification},
22
+ author={Lennart Keller and Goran Glavaš},
23
+ year={2024},
24
+ eprint={2409.06372},
25
+ archivePrefix={arXiv},
26
+ primaryClass={cs.CL},
27
+ url={https://arxiv.org/abs/2409.06372},
28
+ }
29
+ """.strip()
30
+ DESCRIPTION = "Multlingual Semantic Speech Classification"
31
  SAVE_DIR = Path("/hdd/lennart/datasets")
32
 
33
  # Define some arguments and 'constants'
 
38
  )
39
  REWRITE_MASS_PATHS = ("/Volumes/SanDiskData/", "/hdd/lennart/")
40
  ALIGNED_TABLES_DIR = Path("aligned_tables")
41
+ INCLUDE_MASS_LANGUAGES = False
42
  MASS_LANGUAGES = ("eng", "rus", "spa", "ron", "eus", "fra")
43
  SKIP_LANGUAGES = ("ron", "eus", "spa", "hau", "bdv", "nep", "ben")
44
  SCRIPT_TEMPLATE = Path("SpeechTaxi.py.jinja")
45
 
46
+ if not INCLUDE_MASS_LANGUAGES:
47
+ SKIP_LANGUAGES += MASS_LANGUAGES
48
 
49
  def rewrite_path(p: str | Path) -> str | Path:
50
  if REWRITE_PATHS:
 
225
  key = machine_generated_transcription_file.stem.split("_one_channel-")[-1]
226
  key = key.removesuffix("-transcript")
227
  # print(audio_file, "|", machine_generated_transcription_file, "|", key)
228
+ machine_generated_transcriptions[f"transcription_{key}"] = (
229
  machine_generated_transcription_file.read_text()
230
  )
231
  data = {
 
278
  .removesuffix("-transcript")
279
  .strip("-")
280
  )
281
+ # if key.endswith("mms"):
282
+ # continue
283
  # print(audio_file, "|", machine_generated_transcription_file, "|", key)
284
+ machine_generated_transcriptions[f"transcription_{key}"] = (
285
  machine_generated_transcription_file.read_text()
286
  )
287
 
 
358
  except Exception as e:
359
  print("Error reading file", audio_file)
360
  print(e)
361
+ print("_" * 30)
362
  continue
363
  # Files that can't be read have zero alignment scores anyways so in most cases this isn't an issue
364
  data = (
 
380
  except Exception as e:
381
  print("Error reading file", audio_file)
382
  print(e)
383
+ print("_" * 30)
384
  continue
385
  # Files that can't be read have zero alignment scores anyways so in most cases this isn't an issue
386
  data = data | {
 
390
  "audio": copied_audio_file.relative_to(data_dir).as_posix(),
391
  }
392
  final_table_data.append(data)
393
+ pbar.set_description(
394
+ f"{str(alignment_table)} | Total invalid: {invalid_counter}"
395
+ )
396
+
397
  final_table = pd.DataFrame.from_records(final_table_data)
398
  final_table.to_csv(table_dir / alignment_table.name, index=False, sep="\t")
399
 
data.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e0199424abee149174d9ea5eb0a12b4828ff21d1ffd6670cbd4f2244e43e305e
3
- size 2905453052
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e14e207cb519590033888b4b2f4c26c5f7f631c288f5e84ea2e5b3d4ed648592
3
+ size 1781086177
tables.zip CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:6b4ac7fc8d111d463295402b1469117ef74ba5bdfa7ddc5b9a2fae3fef2f4306
3
- size 7586373
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5d31472713cba7263aefd92133953bc0096a8c7175e27bcae669264297080e2b
3
+ size 6999392