Denhotech commited on
Commit
5f85b2f
·
verified ·
1 Parent(s): 02e5488

Upload folder using huggingface_hub

Browse files
Files changed (5) hide show
  1. README.md +17 -0
  2. audio/segment_000.wav +3 -0
  3. audio/segment_001.wav +3 -0
  4. dataset_info.py +44 -0
  5. mapping.txt +5 -0
README.md ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: en
3
+ license: mit
4
+ datasets:
5
+ - custom
6
+ ---
7
+
8
+ # Audio-Text Dataset
9
+
10
+ This dataset contains 2 audio segments with their corresponding text.
11
+
12
+ ## Format
13
+ - **audio**: Audio files in WAV format
14
+ - **text**: Corresponding text transcription
15
+
16
+ ## Created on
17
+ 2025-05-16 17:15:11
audio/segment_000.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8752e98499fc217d9bfdd5f373aed5da42ae0987f56ed40ce30f6e984386f844
3
+ size 480044
audio/segment_001.wav ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d6bef2c07fcd6ba44cb2c8e3713fa82d6cb0fd4e4fc0d921bbdcb3ebcd622b80
3
+ size 451244
dataset_info.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ import os
3
+ import datasets
4
+
5
+ class AudioTextDataset(datasets.GeneratorBasedBuilder):
6
+ VERSION = datasets.Version("1.0.0")
7
+
8
+ def _info(self):
9
+ return datasets.DatasetInfo(
10
+ features=datasets.Features({
11
+ "audio": datasets.Audio(sampling_rate=22050),
12
+ "text": datasets.Value("string")
13
+ })
14
+ )
15
+
16
+ def _split_generators(self, dl_manager):
17
+ return [
18
+ datasets.SplitGenerator(
19
+ name=datasets.Split.TRAIN,
20
+ gen_kwargs={"split": "train"}
21
+ )
22
+ ]
23
+
24
+ def _generate_examples(self, split):
25
+ audio_dir = os.path.join(os.path.dirname(__file__), "audio")
26
+ audio_files = sorted([f for f in os.listdir(audio_dir) if f.endswith(".wav")])
27
+
28
+ # Load the mapping of audio files to text
29
+ text_mapping = {}
30
+ mapping_path = os.path.join(os.path.dirname(__file__), "mapping.txt")
31
+ with open(mapping_path, "r", encoding="utf-8") as f:
32
+ for line in f:
33
+ parts = line.strip().split("\t")
34
+ if len(parts) == 2:
35
+ audio_file, text = parts
36
+ text_mapping[audio_file] = text
37
+
38
+ for idx, audio_file in enumerate(audio_files):
39
+ if audio_file in text_mapping:
40
+ yield idx, {
41
+ "audio": os.path.join(audio_dir, audio_file),
42
+ "text": text_mapping[audio_file]
43
+ }
44
+
mapping.txt ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ segment_000.wav\tKwihela kwa shibyalīlwe sha ng'wa Yesu Kilisto
2
+ (Luk 3:23-38)
3
+ 1Ūyū kūlī kwihela kwa shibyalīlwe sha ng'wa Yesu Kilisto wa lūganda lwa ng'wa Daūdi, mu būbyīle wa ng'wa Abulahamu.\nsegment_001.wav\tKwihela kwa shibyalīlwe sha ng'wa Yesu Kilisto
4
+ (Luk 3:23-38)
5
+ 1Ūyū kūlī kwihela kwa shibyalīlwe sha ng'wa Yesu Kilisto wa lūganda lwa ng'wa Daūdi, mu būbyīle wa ng'wa Abulahamu.\n