-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/lhotse-speech/lhotse
- Loading branch information
Showing
29 changed files
with
2,821 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
numpy>=1.18.1 | ||
sphinx_rtd_theme==2.0.0 | ||
sphinx==7.2.6 | ||
sphinx==7.1.2 | ||
sphinx-click==5.1.0 | ||
sphinx-autodoc-typehints==2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import click | ||
|
||
from lhotse.bin.modes import prepare | ||
from lhotse.recipes.emilia import prepare_emilia | ||
from lhotse.utils import Pathlike | ||
|
||
|
||
@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( | ||
"-l", | ||
"--lang", | ||
type=str, | ||
help="The language to process. Valid values: zh, en, ja, ko, de, fr", | ||
) | ||
@click.option( | ||
"-j", | ||
"--num-jobs", | ||
type=int, | ||
default=1, | ||
help="How many threads to use (can give good speed-ups with slow disks).", | ||
) | ||
def emilia( | ||
corpus_dir: Pathlike, | ||
output_dir: Pathlike, | ||
lang: str, | ||
num_jobs: int = 1, | ||
): | ||
"""Prepare the Emilia corpus manifests.""" | ||
prepare_emilia( | ||
corpus_dir=corpus_dir, | ||
output_dir=output_dir, | ||
lang=lang, | ||
num_jobs=num_jobs, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
from typing import Optional, Sequence, Union | ||
|
||
import click | ||
|
||
from lhotse.bin.modes import download, prepare | ||
from lhotse.recipes.fleurs import download_fleurs, prepare_fleurs | ||
from lhotse.utils import Pathlike | ||
|
||
__all__ = ["fleurs"] | ||
|
||
|
||
@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( | ||
"-j", | ||
"--num-jobs", | ||
type=int, | ||
default=1, | ||
help="How many threads to use (can give good speed-ups with slow disks).", | ||
) | ||
@click.option( | ||
"-l", | ||
"--lang", | ||
multiple=True, | ||
default=["all"], | ||
help="Specify which languages to prepare, e.g., " | ||
" lhoste prepare librispeech mtedx_corpus data -l de -l fr -l es ", | ||
) | ||
def fleurs( | ||
corpus_dir: Pathlike, | ||
output_dir: Pathlike, | ||
num_jobs: int, | ||
lang: Optional[Union[str, Sequence[str]]], | ||
): | ||
"""Fleurs ASR data preparation.""" | ||
prepare_fleurs(corpus_dir, output_dir=output_dir, num_jobs=num_jobs, languages=lang) | ||
|
||
|
||
@download.command(context_settings=dict(show_default=True)) | ||
@click.argument("target_dir", type=click.Path()) | ||
@click.option( | ||
"-l", | ||
"--lang", | ||
multiple=True, | ||
default=["all"], | ||
help="Specify which languages to download, e.g., " | ||
" lhotse download fleurs . -l hi_in -l en_us " | ||
" lhotse download fleurs", | ||
) | ||
@click.option( | ||
"--force-download", | ||
type=bool, | ||
is_flag=True, | ||
default=False, | ||
help="Specify whether to overwrite an existing archive", | ||
) | ||
def fleurs( | ||
target_dir: Pathlike, | ||
lang: Optional[Union[str, Sequence[str]]], | ||
force_download: bool = False, | ||
): | ||
"""FLEURS download.""" | ||
download_fleurs( | ||
target_dir, | ||
languages=lang, | ||
force_download=force_download, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
from typing import List, Optional, Sequence, Tuple, Union | ||
|
||
import click | ||
|
||
from lhotse.bin.modes import prepare | ||
from lhotse.recipes.radio import prepare_radio | ||
from lhotse.utils import Pathlike | ||
|
||
__all__ = ["radio"] | ||
|
||
|
||
@prepare.command(context_settings=dict(show_default=True)) | ||
@click.argument("corpus_dir", type=click.Path(dir_okay=True)) | ||
@click.argument("output_dir", type=click.Path(dir_okay=True)) | ||
@click.option( | ||
"-d", | ||
"--min-seg-dur", | ||
type=float, | ||
default=0.5, | ||
help="The minimum segment duration", | ||
) | ||
@click.option( | ||
"-j", | ||
"--num-jobs", | ||
type=int, | ||
default=4, | ||
help="The number of parallel threads to use for data preparation", | ||
) | ||
def radio( | ||
corpus_dir: Pathlike, | ||
output_dir: Pathlike, | ||
min_seg_dur: float = 0.5, | ||
num_jobs: int = 4, | ||
): | ||
"""Data preparation""" | ||
prepare_radio( | ||
corpus_dir, | ||
output_dir=output_dir, | ||
num_jobs=num_jobs, | ||
min_segment_duration=min_seg_dur, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Oops, something went wrong.