Skip to main content

The CLI for perform actions over the Open Speech Corpus

Project description

Open Speech Corpus CLI

This repository contains the code required to download audiodata from openspeechcorpus.com

Open Speech Corpus is composed by far for three subcorpuses:

  • Tales: A crowdsourced corpus based on reading of latin american short tales
  • Aphasia: A crowdsourced corpus based in words categorized in 4 levels of difficulty
  • Isolated words: A crowdsourced corpus based in isolated words

To download files from the Tales Project use

ops  \
    --output_folder tales/ \
    --output_file tales.txt  \
    --corpus tales

To download files from the Isolated Words Project use

ops  \
    --output_folder isolated_words/ \
    --output_file isolated_words.txt  \
    --corpus words

To download files from the Aphasia Project use

ops  \
    --output_folder aphasia/ \
    --output_file aphasia.txt  \
    --corpus aphasia

By default the page size is 500, to modify it use the args --from and --to i.e:

ops  \
    --from 500 \
    --to 1000 \
    --output_folder aphasia/ \
    --output_file aphasia.txt  \
    --corpus aphasia

You can download the whole corpus using the flag --download_all

ops  \
    --output_folder aphasia/ \
    --output_file aphasia.txt  \
    --corpus aphasia \
    --download_all

If you use the flag --download_all with the flag --from the process will start in the specified arg from using a page size of 500

We also support an argument --extra_query_params which overwrites the --from, --to and --download_all arguments and downloads all files in the body response, you must define the --corpus argument anyway

Recursive Convert

The Open Speech Corpus stores its files in mp4 format, which is undesired for most audio processing tasks. To convert the files into a wav format, first install ffmpeg, then you can execute the recursive_convert utility which receives as first argument the source_folder with the mp4 files and as second argument the output folder i.e.:

recursive_convert aphasia aphasia_wav

CMU Sphinx Configuration

The Open Speech Corpus also defines some scripts to generate configurations for CMU Sphinx.

First initialize a project with the sphinx_train command

sphinxtrain -t simple_words setup

To generate a configuration use the command configure_sphinx, which creates the transcription, fileids, fillers and dic files.

configure_sphinx simple_words \
    --transcription_file words.txt \
    --etc_folder simple_words/etc \
    --test_size 0.5

Also you need to define a language model which receives the DB_NAME and the base project folder

generate_language_model simple_words simple_words

To delete the configuration files use the command clean_previous_configuration

clean_previous_configuration simple_words --etc_folder simple_words/etc/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for openspeechcorpus, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size openspeechcorpus-0.1.6-py3.7.egg (28.6 kB) File type Egg Python version 3.7 Upload date Hashes View
Filename, size openspeechcorpus-0.1.6.tar.gz (8.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page