Skip to content

Commit

Permalink
Add recipe for the Santa Barbara Corpus of Spoken American English (S…
Browse files Browse the repository at this point in the history
…BCSAE) (#1395)

* initial commit

* transcript fixes

* added SBCSAE download

* Updates sbcsae to properly process mono_channel audio and adds speaker origin as geolocations for speakers

* Fixes a few 0-width segments by adding 0.02 s of padding

* small fix

* Add alignment export option

Exports aligned supervisions along with the original supervisions with or without changing the text after manual inspections and corrections.

* update to cli flags and docs

* added sbcsae to docs and fixed python compatibility

* more python3.8 fixes

---------

Co-authored-by: Matthew Wiesner <[email protected]>
Co-authored-by: Dominik Klement <[email protected]>
Co-authored-by: Piotr Żelasko <[email protected]>
  • Loading branch information
4 people authored Oct 4, 2024
1 parent c8ba6d0 commit d1b078b
Show file tree
Hide file tree
Showing 5 changed files with 1,217 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/corpus.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ a CLI tool that create the manifests given a corpus directory.
- :func:`lhotse.recipes.prepare_reazonspeech`
* - RIRs and Noises Corpus (OpenSLR 28)
- :func:`lhotse.recipes.prepare_rir_noise`
* - SBCSAE
- :func:`lhotse.recipes.prepare_sbcsae`
* - Spatial-LibriSpeech
- :func:`lhotse.recipes.prepare_spatial_librispeech`
* - Speech Commands
Expand Down
1 change: 1 addition & 0 deletions lhotse/bin/modes/recipes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
from .primewords import *
from .reazonspeech import *
from .rir_noise import *
from .sbcsae import *
from .slu import *
from .spatial_librispeech import *
from .speechcommands import *
Expand Down
58 changes: 58 additions & 0 deletions lhotse/bin/modes/recipes/sbcsae.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from typing import Optional, Sequence

import click

from lhotse.bin.modes import download, prepare
from lhotse.recipes.sbcsae import download_sbcsae, prepare_sbcsae
from lhotse.utils import Pathlike

__all__ = ["sbcsae"]


@prepare.command(context_settings=dict(show_default=True))
@click.argument("corpus_dir", type=click.Path(exists=True, dir_okay=True))
@click.argument("output_dir", type=click.Path())
@click.option(
"--geolocation",
type=bool,
is_flag=True,
default=False,
help="Include geographic coordinates of speakers' hometowns in the manifests.",
)
@click.option(
"--omit-realignments",
type=bool,
is_flag=True,
default=False,
help="Only output the original corpus segmentation without boundary improvements.",
)
def sbcsae(
corpus_dir: Pathlike,
output_dir: Pathlike,
geolocation: bool,
omit_realignments: bool,
):
"""SBCSAE data preparation."""
prepare_sbcsae(
corpus_dir,
output_dir=output_dir,
geolocation=geolocation,
omit_realignments=omit_realignments,
)


@download.command(context_settings=dict(show_default=True))
@click.argument("target_dir", type=click.Path())
@click.option(
"--force-download",
type=bool,
is_flag=True,
default=False,
help="Force download.",
)
def sbcsae(
target_dir: Pathlike,
force_download: bool,
):
"""SBCSAE download."""
download_sbcsae(target_dir, force_download=force_download)
1 change: 1 addition & 0 deletions lhotse/recipes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
from .peoples_speech import prepare_peoples_speech
from .reazonspeech import download_reazonspeech, prepare_reazonspeech
from .rir_noise import download_rir_noise, prepare_rir_noise
from .sbcsae import download_sbcsae, prepare_sbcsae
from .slu import prepare_slu
from .spatial_librispeech import (
download_spatial_librispeech,
Expand Down
Loading

0 comments on commit d1b078b

Please sign in to comment.