benjaminogbonna's picture
Update README.md
23063ce verified
metadata
license: apache-2.0
task_categories:
  - automatic-speech-recognition
  - text-to-speech
language:
  - en
  - af
pretty_name: Nigerian Accent English Speech Data 1.0
annotations_creators:
  - crowdsourced
language_creators:
  - crowdsourced
size_categories:
  - 1K<n<10K
extra_gated_prompt: >-
  By clicking on “Access repository” below, you also agree to not attempt to
  determine the identity of speakers in the Common Voice dataset.
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: validation
        path: data/validation-*
      - split: test
        path: data/test-*
dataset_info:
  features:
    - name: audio
      dtype: audio
    - name: client_id
      dtype: string
    - name: path
      dtype: string
    - name: sentence
      dtype: string
    - name: accent
      dtype: string
    - name: locale
      dtype: string
    - name: segment
      dtype: float64
  splits:
    - name: train
      num_bytes: 102146340.008
      num_examples: 2721
    - name: validation
      num_bytes: 12091191
      num_examples: 340
    - name: test
      num_bytes: 11585096
      num_examples: 341
  download_size: 121509986
  dataset_size: 125822627.008

Dataset Card for Nigerian Accent English Speech Data 1.0

Table of Contents

Dataset Description

Dataset Summary

The Nigerian Accent Speech Data is a comprehensive dataset of about 8 hours of audio recordings featuring speakers from various regions of Nigeria, capturing the rich diversity of Nigerian accents. This dataset is specifically curated to address the gap in speech and language datasets for African accents, making it a valuable resource for researchers and developers working on Automatic Speech Recognition (ASR), Speech-to-text (STT), Text-to-Speech (TTS), Accent recognition, and Natural language processing (NLP) systems.

Languages

Afrikaans, English

How to use

The datasets library allows you to load and pre-process your dataset in pure Python, at scale. The dataset can be downloaded and prepared in one call to your local drive by using the load_dataset function.

For example, to download:

from datasets import load_dataset
dataset = load_dataset("benjaminogbonna/nigerian_accented_english_dataset", split="train")

Using the datasets library, you can also stream the dataset on-the-fly by adding a streaming=True argument to the load_dataset function call. Loading a dataset in streaming mode loads individual samples of the dataset at a time, rather than downloading the entire dataset to disk.

from datasets import load_dataset
dataset = load_dataset("benjaminogbonna/nigerian_accented_english_dataset", split="train", streaming=True)
print(next(iter(dataset)))

Bonus: create a PyTorch dataloader directly with your own datasets (local/streamed).

Local

from datasets import load_dataset
from torch.utils.data.sampler import BatchSampler, RandomSampler
dataset = load_dataset("benjaminogbonna/nigerian_accented_english_dataset", split="train")
batch_sampler = BatchSampler(RandomSampler(dataset), batch_size=32, drop_last=False)
dataloader = DataLoader(dataset, batch_sampler=batch_sampler)

Streaming

from datasets import load_dataset
from torch.utils.data import DataLoader
dataset = load_dataset("benjaminogbonna/nigerian_accented_english_dataset", split="train")
dataloader = DataLoader(dataset, batch_size=32)

To find out more about loading and preparing audio datasets, head over to hf.co/blog/audio-datasets.

Example scripts

Train your own CTC or Seq2Seq Automatic Speech Recognition models on Nigerian Accent English Speech Data with transformers - here.

Dataset Structure

Data Instances

A typical data point comprises the path to the audio file and its sentence. Additional fields include accent, client_id, locale and segment.

{
  'client_id': 'user_3279', 
  'path': 'clips/audio_sample_3280.mp3',
  'audio': {
    'path': 'clips/audio_sample_1.mp3', 
    'array': array([-0.00048828, -0.00018311, -0.00137329, ...,  0.00079346, 0.00091553,  0.00085449], dtype=float32), 
    'sampling_rate': 48000
  },
  'sentence': 'Its images were used by among others Palestinians in their protest against Israel', 
  'accent': 'nigerian', 
  'locale': 'en', 
  'segment': None
}

Data Fields

client_id (string): An id for which client (voice) made the recording

path (string): The path to the audio file

audio (dict): A dictionary containing the path to the downloaded audio file, the decoded audio array, and the sampling rate. Note that when accessing the audio column: dataset[0]["audio"] the audio file is automatically decoded and resampled to dataset.features["audio"].sampling_rate. Decoding and resampling of a large number of audio files might take a significant amount of time. Thus it is important to first query the sample index before the "audio" column, i.e. dataset[0]["audio"] should always be preferred over dataset["audio"][0]

sentence (string): The sentence the user was prompted to speak

accent (string): Accent of the speaker

locale (string): The locale of the speaker

segment (string): Usually an empty field

Data Splits

The dataset has been subdivided into portions for dev, train and test.

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 “the cat sat on the mat.“. 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("benjaminogbonna/nigerian_accented_english_dataset")
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")

Personal and Sensitive Information

The dataset consists of people who have donated their voice online. You agree to not attempt to determine the identity of speakers in the Common Voice dataset.

Social Impact of Dataset

The dataset consists of people who have donated their voice online. You agree to not attempt to determine the identity of speakers in the Common Voice dataset.

Contributions