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
Refactor prep_segments in SVS #5210
Conversation
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## master #5210 +/- ##
==========================================
+ Coverage 74.54% 74.98% +0.44%
==========================================
Files 640 655 +15
Lines 57267 58552 +1285
==========================================
+ Hits 42688 43908 +1220
- Misses 14579 14644 +65
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 58 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
super thanks! it would be great if we can create a better doc in egs/TEMPLATE/svs1 to instruct people how to use the tool
label_info, text_info = process_text_info( | ||
os.path.join(src_data, folder, "{}.lab".format(folder)) | ||
) | ||
# text_scp.write("{} {}\n".format(utt_id, text_info)) |
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.
Why do you remove the write of text_scp and midiscp?
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.
Why do you remove the write of text_scp and midiscp?
I think they are not used in this dataset. I find that ofuton also doesn't use text_scp and midiscp, so I removed them. Should I keep them?
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.
If it is not used, let's remove them.
The modification functions in new prep_segment look great. But it would be too long if we put all datasets in it. |
I see. I think it would be a good idea to generate a dict in check_align.py, then I can use the dict in prep_segments.py. In that case, all the errors will be auto-fixed, and we don't have to put those dicts inside the code. But currently I don't know how to save and load (also append a function to) this dict. |
Looks good to me. Could you also add the related docs in template/svs1/readme ? I'm still not pretty sure about the potential steps we need to do with the regarding updates. |
label_info, text_info = process_text_info( | ||
os.path.join(src_data, folder, "{}.lab".format(folder)) | ||
) | ||
# text_scp.write("{} {}\n".format(utt_id, text_info)) |
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.
If it is not used, let's remove them.
LGTM! @A-Quarter-Mile could you double check it? |
I still suggest removing natsume from new prep_segments and keeping the one in local/. There are some special designs for it (mid_reader and align_lyric_notes), which are not applicable for other datasets. Besides, the modifications for natsume in new prep_segments are based on manual inspection, we can remove them safely. |
Co-authored-by: Jiatong <728307998@qq.com>
LGTM! @A-Quarter-Mile could you double check this update? After your confirmation and CI cleared, I will merge the PR. |
Many thanks! Code merged. |
@ftshijt @A-Quarter-Mile
I plan to use only one file for preprocessing labels and XML files, instead of using
local/prep_segments.py
andlocal/prep_segments_from_xml.py
in every dataset, which will be placed underpyscripts/utils
.To fix dataset errors, we can use several functions (
replace_lyrics
,replace_labels
,skip_labels
,add_missing_phoneme
,add_pause
) to handle specific errors. We can use a dictionaryerror_correction
to store error handling functions in each dataset.In order to use this new function, previous scripts for datasets that use XML files should be changed.
pyscripts/utils/prep_segments.py
and add parameters such as--dataset natsume
and--input_type hts/xml
. Please see Natsume example.local/prep_segments.py
,local/prep_segments_from_xml.py
andpyscripts/utils/prep_segments_from_xml.py