Guide To LibriSpeech Datasets With Implementation in PyTorch and TensorFlow

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

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.


Download Size: 58GB Approx.

Dataset Size: 305GB Approx.

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

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 import DataLoader
 from 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
 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
 from import Dataset
 from models.ctc.vanilla_ctc import CTC
 from 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. 


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.


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.


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.

More Great AIM Stories

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

More Stories


8th April | In-person Conference | Hotel Radisson Blue, Bangalore

Organized by Analytics India Magazine

View Event >>

30th Apr | Virtual conference

Organized by Analytics India Magazine

View Event >>

Yugesh Verma
All you need to know about Graph Embeddings

Embeddings can be the subgroups of a group, similarly, in graph theory embedding of a graph can be considered as a representation of a graph on a surface, where points of that surface are made up of vertices and arcs are made up of edges

Yugesh Verma
A beginner’s guide to Spatio-Temporal graph neural networks

Spatio-temporal graphs are made of static structures and time-varying features, and such information in a graph requires a neural network that can deal with time-varying features of the graph. Neural networks which are developed to deal with time-varying features of the graph can be considered as Spatio-temporal graph neural networks. 

Vijaysinh Lendave
How to Evaluate Recommender Systems with RGRecSys?

A recommender system, sometimes known as a recommendation engine, is a type of information filtering system that attempts to forecast a user’s “rating” or “preference” for an item. In this post, we will look at RGRecSys, a library that performs constraint evaluation of recommender systems.

3 Ways to Join our Community

Discord Server

Stay Connected with a larger ecosystem of data science and ML Professionals

Telegram Channel

Discover special offers, top stories, upcoming events, and more.

Subscribe to our newsletter

Get the latest updates from AIM