File size: 2,730 Bytes
93bc619
 
ebc6d6b
 
c8d1da9
ebc6d6b
c8d1da9
 
ebc6d6b
c8d1da9
 
767c5cb
ce07f07
b307731
 
ce07f07
 
 
 
4855b8a
 
 
 
ce07f07
 
 
 
 
4855b8a
ce07f07
 
 
 
 
 
 
 
767c5cb
8c33e03
ce07f07
4855b8a
ce07f07
 
767c5cb
d06cbbf
 
767c5cb
d06cbbf
 
 
 
 
c924bd0
d06cbbf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c924bd0
d06cbbf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---

license: apache-2.0
task_categories:
  - automatic-speech-recognition
language:
  - uz
pretty_name: Uzbek Language Speech-to-Text Dataset
size_categories:
  - 100K<n<1M

---



The dataset is organized into the following directories and files:

audio/

other/: Contains .tar archives like uz_other_0.taruz_other_1.tar
train/: Contains .tar archives like uz_train_0.tar.
validated/: Contains .tar archives like uz_validated_0.tar, uz_validated_1.tar, and uz_validated_2.tar.
test/: Contains individual .wav files.
transcription/: Contains .tsv files including:

other.tsv
train.tsv
validated.tsv
test.tsv
The .tsv files have two columns: file_name and transcription. Each entry provides the path to the audio file and its corresponding transcription.

Data Instances
A typical data point includes:

Audio File: Path to the .wav and mp3 files.
Transcription: Text transcribed from the audio.
Example data instance:


{
  "file_name": "audio/train/common_voice_uz_28907218.mp3",
  "transcription": "Bugun ertalab Gyotenikiga taklifnoma oldim."
}

Data Preprocessing Recommended by Hugging Face
The following are data preprocessing steps advised by the Hugging Face team. They are accompanied by an example code snippet that shows how to put them to practice.

Many examples in this dataset have trailing quotations marks, e.g "Musibat yomonlarning zulmida emas, yaxshilarning jim turishida.". These trailing quotation marks do not change the actual meaning of the sentence, and it is near impossible to infer whether a sentence is a quotation or not a quotation from audio data alone. In these cases, it is advised to strip the quotation marks, leaving: the cat sat on the mat.

In addition, the majority of training sentences end in punctuation ( . or ? or ! ), whereas just a small proportion do not. In the dev set, almost all sentences end in punctuation. Thus, it is recommended to append a full-stop ( . ) to the end of the small number of training examples that do not end in punctuation.

---
'''
from datasets import load_dataset

ds = load_dataset("mozilla-foundation/common_voice_17", "en", use_auth_token=True)

def prepare_dataset(batch):
  """Function to preprocess the dataset with the .map method"""
  transcription = batch["sentence"]
  
  if transcription.startswith('"') and transcription.endswith('"'):
    # we can remove trailing quotation marks as they do not affect the transcription
    transcription = transcription[1:-1]
  
  if transcription[-1] not in [".", "?", "!"]:
    # append a full-stop to sentences that do not end in punctuation
    transcription = transcription + "."
  
  batch["sentence"] = transcription
  
  return batch

ds = ds.map(prepare_dataset, desc="preprocess dataset")
'''
---