MITB Banner

Guide To LibriSpeech Datasets With Implementation in PyTorch and TensorFlow

The Librispeech dataset is SLR12 which is the audio recording of reading English speech.

Share

LibriSpeech is developed by OpenSLR with all data collected by his research student. Danial Povey is an assistant professor at Johns Hopkins University in the Center for Language and Speech Processing as a speech recognition researcher. LibriSpeech is a collection of more than 1000 hours of speech data which is collected by Vassil Panayotov with the assistance of Daniel Povey. It is used in many applications such as speaker recognition and automatic speaker verification.

Paper:https://www.danielpovey.com/publications.html

Download Size: 58GB Approx.

Dataset Size: 305GB Approx.

To Download the dataset on a local computer visit the link here:

http://www.openslr.org/12

About DataSet:

OpenSLR(Open speech and language resources) has 93 SLRs in the domain of software, audio, music, speech, and text dataset open for download. The Librispeech dataset is SLR12 which is the audio recording of reading English speech. The file format of data is in the form of FLAC(Free Lossless Audio Codec) without any loss in quality or loss of any original audio data.

Using Pytorch:

 import os
 import torch
 import pickle
 import random
 import torchaudio
 import numpy as np
 import pandas as pd
 from tqdm import tqdm
 from librosa.util import find_files
 from torch.utils.data import DataLoader
 from torch.utils.data.dataset import Dataset
 from torch.nn.utils.rnn import pad_sequence
 from utility.preprocessor import OnlinePreprocessor
 from transformer.mam import process_train_MAM_data,     process_test_MAM_data
 HALF_BATCHSIZE_TIME = 3000
 SPEAKER_THRESHOLD = 0
 def get_online_Dataloader(args, config, is_train=True):
     # create waveform dataset
     dataset = OnlineDataset(**config['online'])
     print('[Dataset] - Using Online Dataset.')
     # create dataloader for extracting features
     def collate_fn(samples):
         # samples: [(seq_len, channel), ...]
         samples = pad_sequence(samples, batch_first=True)
         # samples: (batch_size, max_len, channel)
         return samples.transpose(-1, -2).contiguous()
         # return: (batch_size, channel, max_len)
     dataloader = DataLoader(dataset, batch_size=config['dataloader']['batch_size'],
           shuffle=is_train, num_workers=config['dataloader']['n_jobs'],
                             pin_memory=True, collate_fn=collate_fn)
     return dataloader 

For Implementation in Pytorch visit the following link.

Using Tensorflow:

 import os
 import sys
 import numpy as np
 import tensorflow as tf
 import yaml
 import argparse
 sys.path.append(os.path.abspath('../../../'))
 from experiments.librispeech.data.load_dataset_ctc import Dataset
 from models.ctc.vanilla_ctc import CTC
 from utils.directory import mkdir_join
 parser = argparse.ArgumentParser()
 parser.add_argument('--epoch', type=int, default=-1,
                     help='the epoch to restore')
 parser.add_argument('--model_path', type=str,
                     help='path to the model to evaluate')
 parser.add_argument('--eval_batch_size', type=str, default=1,
                     help='the size of mini-batch in evaluation')


 For implementation in TensorFlow visit the link. 

Application:

1. Kaldi Speech Recognition toolkit:

LibriSpeech Dataset is used in the Kaldi Speech recognition to extract text from speech. It is useful in a speech to text generation. There are many software developed using the Kaldi toolkit for speech recognition.

Github: https://github.com/kaldi-asr/kaldi.

2.Sentiment classification of  spoken speech:

The sentiment of the speech using LibreSpeech dataset to train the model to automatically detect their emotion in speech.

3.Speaker recognition:

To verify the gender and emotion of the speaker, their accent to catch their range of age.

4. Automatic speech recognition:

Automatic speech recognition is used in the process of speech to text and text to speech recognition. Model is trained using a natural language processing toolkit.

Conclusion:

We have learned about the LibriSpeech dataset, how we can download it from the source. Librispeech dataset creator and their researcher. Implementation of model in PyTorch data loader for Kaldi speech recognition toolkit. Using Tensorflow for the end-to-end speech recognition and some of the application is used in daily life using Librispeech Datasets.

Share
Picture of Amit Singh

Amit Singh

Amit Singh is Data Scientist, graduated in Computer Science and Engineering. Data Science writer at Analytics India Magazine.
Related Posts

CORPORATE TRAINING PROGRAMS ON GENERATIVE AI

Generative AI Skilling for Enterprises

Our customized corporate training program on Generative AI provides a unique opportunity to empower, retain, and advance your talent.

Upcoming Large format Conference

May 30 and 31, 2024 | 📍 Bangalore, India

Download the easiest way to
stay informed

Subscribe to The Belamy: Our Weekly Newsletter

Biggest AI stories, delivered to your inbox every week.

AI Courses & Careers

Become a Certified Generative AI Engineer

AI Forum for India

Our Discord Community for AI Ecosystem, In collaboration with NVIDIA. 

Flagship Events

Rising 2024 | DE&I in Tech Summit

April 4 and 5, 2024 | 📍 Hilton Convention Center, Manyata Tech Park, Bangalore

MachineCon GCC Summit 2024

June 28 2024 | 📍Bangalore, India

MachineCon USA 2024

26 July 2024 | 583 Park Avenue, New York

Cypher India 2024

September 25-27, 2024 | 📍Bangalore, India

Cypher USA 2024

Nov 21-22 2024 | 📍Santa Clara Convention Center, California, USA

Data Engineering Summit 2024

May 30 and 31, 2024 | 📍 Bangalore, India

Subscribe to Our Newsletter

The Belamy, our weekly Newsletter is a rage. Just enter your email below.