Skip to content
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

这个代码块少了一个缩进 #1826

Merged
merged 1 commit into from
Apr 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions examples/other/mfa/local/reorganize_aishell3.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ def write_lab(root_dir: Union[str, Path],
text_path = root_dir / sub_set / 'content.txt'
new_dir = output_dir / sub_set

with open(text_path, 'r') as rf:
for line in rf:
wav_id, context = line.strip().split('\t')
spk_id = wav_id[:7]
transcript_name = wav_id.split('.')[0] + '.lab'
transcript_path = new_dir / spk_id / transcript_name
context_list = context.split()
word_list = context_list[0:-1:2]
pinyin_list = context_list[1::2]
wf = open(transcript_path, 'w')
if script_type == 'word':
# add space between chinese char
new_context = ' '.join(word_list)
elif script_type == 'pinyin':
new_context = ' '.join(pinyin_list)
wf.write(new_context + '\n')
with open(text_path, 'r') as rf:
for line in rf:
wav_id, context = line.strip().split('\t')
spk_id = wav_id[:7]
transcript_name = wav_id.split('.')[0] + '.lab'
transcript_path = new_dir / spk_id / transcript_name
context_list = context.split()
word_list = context_list[0:-1:2]
pinyin_list = context_list[1::2]
wf = open(transcript_path, 'w')
if script_type == 'word':
# add space between chinese char
new_context = ' '.join(word_list)
elif script_type == 'pinyin':
new_context = ' '.join(pinyin_list)
wf.write(new_context + '\n')


def reorganize_aishell3(root_dir: Union[str, Path],
Expand Down