-
Notifications
You must be signed in to change notification settings - Fork 254
ASR,ST and CS recipies #1307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AmirHussein96
wants to merge
13
commits into
lhotse-speech:master
Choose a base branch
from
AmirHussein96:multiling_cs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
ASR,ST and CS recipies #1307
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a4626d6
ASR,ST and CS recipies
25f4802
remove testing lines
AmirHussein96 0fa9aef
Merge branch 'master' into multiling_cs
AmirHussein96 f2cb403
run black
AmirHussein96 1326ddb
black
AmirHussein96 e7c93ca
sorting imports
AmirHussein96 149b4b1
.
AmirHussein96 fb00a2d
.
AmirHussein96 29a3294
Merge branch 'lhotse-speech:master' into multiling_cs
AmirHussein96 3d8e927
fixing the format
AmirHussein96 bd9af25
local import of bs4
AmirHussein96 5b45725
apply black
AmirHussein96 9f21728
adding lids to the batch in K2SpeechRecognitionDataset
AmirHussein96 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,69 @@ | ||
| from typing import Optional, Sequence, Union | ||
|
|
||
| import click | ||
|
|
||
| from lhotse.bin.modes import prepare | ||
| from lhotse.recipes.callhome_spanish_st import prepare_callhome_spanish | ||
| from lhotse.utils import Pathlike | ||
|
|
||
|
|
||
| @prepare.command(context_settings=dict(show_default=True)) | ||
| @click.argument("audio_dir_path", type=click.Path(exists=True, dir_okay=True)) | ||
| @click.argument("transcript_dir_path", type=click.Path(exists=True, dir_okay=True)) | ||
| @click.argument("split_dir", type=click.Path()) | ||
| @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( | ||
| "--absolute_paths", | ||
| default=False, | ||
| help=" Whether to return absolute or relative (to the corpus dir) paths for recordings.", | ||
| ) | ||
| @click.option( | ||
| "--remove_punc", | ||
| default=False, | ||
| help=" Remove punctuations from the text", | ||
| ) | ||
| @click.option( | ||
| "--lowercase", | ||
| default=False, | ||
| help="Lower case the text", | ||
| ) | ||
| def callhome_spanish_st( | ||
| audio_dir_path: Pathlike, | ||
| transcript_dir_path: Pathlike, | ||
| split_dir: Pathlike, | ||
| output_dir: Pathlike, | ||
| absolute_paths: bool, | ||
| remove_punc: bool, | ||
| lowercase: bool, | ||
| num_jobs: int, | ||
| ): | ||
| """ | ||
| Callhome Spanish data preparation. | ||
| \b | ||
| This is conversational telephone speech collected as 2-channel μ-law, 8kHz-sampled data. | ||
| The catalog number LDC96S35 for audio corpus and LDC96T17 for transcripts. | ||
|
|
||
| This data is not available for free - your institution needs to have an LDC subscription. | ||
| You should also download and prepare the pre-defined splits with: | ||
| git clone https://github.com/joshua-decoder/fisher-callhome-corpus.git | ||
| cd fisher-callhome-corpus | ||
| make | ||
| cd ../ | ||
| """ | ||
| prepare_callhome_spanish( | ||
| audio_dir_path=audio_dir_path, | ||
| transcript_dir_path=transcript_dir_path, | ||
| split_dir=split_dir, | ||
| output_dir=output_dir, | ||
| absolute_paths=absolute_paths, | ||
| remove_punc=remove_punc, | ||
| lowercase=lowercase, | ||
| num_jobs=num_jobs, | ||
| ) |
This file contains hidden or 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,69 @@ | ||
| from typing import Optional, Sequence, Union | ||
|
|
||
| import click | ||
|
|
||
| from lhotse.bin.modes import prepare | ||
| from lhotse.recipes.fisher_spanish_st import prepare_fisher_spanish | ||
| from lhotse.utils import Pathlike | ||
|
|
||
|
|
||
| @prepare.command(context_settings=dict(show_default=True)) | ||
| @click.argument("audio_dir_path", type=click.Path(exists=True, dir_okay=True)) | ||
| @click.argument("transcript_dir_path", type=click.Path(exists=True, dir_okay=True)) | ||
| @click.argument("split_dir", type=click.Path()) | ||
| @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( | ||
| "--absolute_paths", | ||
| default=False, | ||
| help=" Whether to return absolute or relative (to the corpus dir) paths for recordings.", | ||
| ) | ||
| @click.option( | ||
| "--remove_punc", | ||
| default=False, | ||
| help=" Remove punctuations from the text", | ||
| ) | ||
| @click.option( | ||
| "--lowercase", | ||
| default=False, | ||
| help="Lower case the text", | ||
| ) | ||
| def fisher_spanish_st( | ||
| audio_dir_path: Pathlike, | ||
| transcript_dir_path: Pathlike, | ||
| split_dir: Pathlike, | ||
| output_dir: Pathlike, | ||
| absolute_paths: bool, | ||
| remove_punc: bool, | ||
| lowercase: bool, | ||
| num_jobs: int, | ||
| ): | ||
| """ | ||
| Fisher Spanish data preparation. | ||
| \b | ||
| This is conversational telephone speech collected as 2-channel μ-law, 8kHz-sampled data. | ||
| The catalog number LDC2010S01 for audio corpus and LDC2010T04 for transcripts. | ||
|
|
||
| This data is not available for free - your institution needs to have an LDC subscription. | ||
| You also should download and prepare the pre-defined splits with: | ||
| git clone https://github.com/joshua-decoder/fisher-callhome-corpus.git | ||
| cd fisher-callhome-corpus | ||
| make | ||
| cd ../ | ||
| """ | ||
| prepare_fisher_spanish( | ||
| audio_dir_path=audio_dir_path, | ||
| transcript_dir_path=transcript_dir_path, | ||
| split_dir=split_dir, | ||
| output_dir=output_dir, | ||
| absolute_paths=absolute_paths, | ||
| remove_punc=remove_punc, | ||
| lowercase=lowercase, | ||
| num_jobs=num_jobs, | ||
| ) |
This file contains hidden or 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,42 @@ | ||
| from typing import Optional, Sequence, Union | ||
|
|
||
| import click | ||
|
|
||
| from lhotse.bin.modes import prepare | ||
| from lhotse.recipes.seame import prepare_seame | ||
| 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("split_dir", type=click.Path(exists=True, dir_okay=True)) | ||
| @click.argument("output_dir", type=click.Path()) | ||
| @click.option( | ||
| "--clean-text", | ||
| default=False, | ||
| help="Whether to perform additional text cleaning and normalization", | ||
| ) | ||
| @click.option( | ||
| "--delimiter", | ||
| default="", | ||
| help="Used to split the code switching text ", | ||
| ) | ||
| def seame( | ||
| corpus_dir: Pathlike, | ||
| split_dir: Pathlike, | ||
| clean_text: bool, | ||
| delimiter: str, | ||
| output_dir: Pathlike, | ||
| ): | ||
| """ | ||
| SEAME data preparation. | ||
| \b | ||
| This is Singaporean Codeswitched English and Mandarin data. | ||
| """ | ||
| prepare_seame( | ||
| corpus_dir=corpus_dir, | ||
| split_dir=split_dir, | ||
| output_dir=output_dir, | ||
| clean_text=clean_text, | ||
| delimiter=delimiter, | ||
| ) |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can just add
”language”: supervision.language,in the line below and always return it to get rid of the extra option and code duplication.