Denhotech commited on
Commit
9eb76d0
·
verified ·
1 Parent(s): 0b3db30

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +10 -0
  2. audio/segment_000.wav +2 -2
  3. dataset_info.py +44 -0
  4. mapping.txt +3 -0
README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ # Audio-Text Dataset
2
+
3
+ This dataset contains 1 audio segments with their corresponding text.
4
+
5
+ ## Format
6
+ - **audio**: Audio files in WAV format
7
+ - **text**: Corresponding text transcription
8
+
9
+ ## Created on
10
+ 2025-05-16 15:46:28
audio/segment_000.wav CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ce63fea55a5918e19a9bcaa79a5daf8892f947f8dc0988874b50fbb54badfdc2
3
- size 750764
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b2eee83ee85f331a8cd451126d75306f91d0099d86e1f8d864d9cc9a427d061a
3
+ size 4060844
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,3 @@
 
 
 
 
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.\n