-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Add speech transcriptions #4920
Open
hygong-fb
wants to merge
2
commits into
facebookresearch:ust
Choose a base branch
from
hygong-fb:ust
base: ust
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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
34 changes: 34 additions & 0 deletions
34
examples/speech_matrix/mined_train_sets/download_transcriptions.py
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,34 @@ | ||
import os | ||
import argparse | ||
from examples.speech_matrix.data_helper.data_cfg import ( | ||
DOWNLOAD_HUB, | ||
VP_LANGS, | ||
trans_key, | ||
TRANS_SRC_LANGS, | ||
TRANS_TGT_LANGS | ||
) | ||
|
||
|
||
def download_transcriptions(src_lang, tgt_lang, save_root): | ||
save_dir = os.path.join(save_root, trans_key) | ||
os.makedirs(save_dir, exist_ok=True) | ||
|
||
sorted_src_lang, sorted_tgt_lang = sorted([src_lang, tgt_lang]) | ||
s2s_dl = f"{DOWNLOAD_HUB}/{trans_key}/{sorted_src_lang}-{sorted_tgt_lang}_{tgt_lang}.tsv.gz" | ||
os.system(f"wget {s2s_dl} -P {save_dir}") | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--save-root", type=str, required=True) | ||
args = parser.parse_args() | ||
|
||
# download transcriptions of ta | ||
for src_lang in TRANS_SRC_LANGS: | ||
for tgt_lang in TRANS_TGT_LANGS: | ||
if src_lang == tgt_lang: | ||
continue | ||
download_transcriptions( | ||
src_lang, tgt_lang, save_root=args.save_root | ||
) |
24 changes: 24 additions & 0 deletions
24
examples/speech_matrix/valid_test_sets/download_vp_valid_test.py
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,24 @@ | ||
import os | ||
import sys | ||
import argparse | ||
from examples.speech_matrix.data_helper.data_cfg import ( | ||
DOWNLOAD_HUB, | ||
audio_key | ||
) | ||
|
||
def download_data(save_root): | ||
save_dir = os.path.join(save_root, audio_key) | ||
aud_dl = f"{DOWNLOAD_HUB}/{audio_key}/valid_test_vp_aud.zip" | ||
os.system(f"wget {aud_dl} -P {save_dir}") | ||
|
||
|
||
if __name__=="__main__": | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--save-root", type=str, required=True) | ||
args = parser.parse_args() | ||
|
||
download_data(args.save_root) | ||
|
||
|
||
|
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.