-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 timestamp support #11591
add timestamp support #11591
Conversation
if has_no_timestamp: | ||
return super().text_to_ids(text_no_eos, lang_id) + [self.eos_id] | ||
else: | ||
word_text = time_pattern.sub("", text_no_eos).strip() |
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.
please refactor into a method def _text_with_timestamps_to_ids(...)
and use return self._text_with_timestamps_to_ids(...)
here
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.
Done.
if time_index < len(time_ids) and result_ids[-1] != (time_ids[-1]): | ||
result_ids.append(time_ids[-1]) | ||
return result_ids + [self.eos_id] | ||
|
||
return super().text_to_ids(text, lang_id) |
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.
you missed this branch (when lang_id isn't CANARY_SPECIAL_TOKENIZER and the text doesn't end in EOS) - it also needs to support tokenizing timestamps
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.
Thanks for catching that - fixed.
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.
Please add a unit test showing how a transcript with timestamp gets correctly tokenized (see tests/collections/asr/test_asr_multitask_model_bpe.py for reference tests you can use as a starting point)
PTAL @pzelasko |
88b09e3
to
fe494ff
Compare
Signed-off-by: kevinhu <[email protected]>
Signed-off-by: kevinhu <[email protected]>
Signed-off-by: kevinhu-nv <[email protected]> Signed-off-by: kevinhu <[email protected]>
fe494ff
to
a64255c
Compare
Signed-off-by: kevinhu-nv <[email protected]>
@pzelasko Can you approve again? Rebased the repo for the tests. |
@titu1994 @stevehuang52 Could you take a look to trigger the workflow checks? |
beep boop 🤖: 🙏 The following files have warnings. In case you are familiar with these, please try helping us to improve the code base. Your code was analyzed with PyLint. The following annotations have been identified:
Mitigation guide:
By applying these rules, we reduce the occurance of this message in future. Thank you for improving NeMo's documentation! |
* add timestamp support Signed-off-by: kevinhu <[email protected]> * Add unit test, fix a branch, and refactor. Signed-off-by: kevinhu <[email protected]> * Apply isort and black reformatting Signed-off-by: kevinhu-nv <[email protected]> Signed-off-by: kevinhu <[email protected]> * Apply isort and black reformatting Signed-off-by: kevinhu-nv <[email protected]> --------- Signed-off-by: kevinhu <[email protected]> Signed-off-by: kevinhu-nv <[email protected]> Co-authored-by: kevinhu-nv <[email protected]>
* add timestamp support Signed-off-by: kevinhu <[email protected]> * Add unit test, fix a branch, and refactor. Signed-off-by: kevinhu <[email protected]> * Apply isort and black reformatting Signed-off-by: kevinhu-nv <[email protected]> Signed-off-by: kevinhu <[email protected]> * Apply isort and black reformatting Signed-off-by: kevinhu-nv <[email protected]> --------- Signed-off-by: kevinhu <[email protected]> Signed-off-by: kevinhu-nv <[email protected]> Co-authored-by: kevinhu-nv <[email protected]>
What does this PR do ?
Add support for parsing timestamp data for training.
Collection: [Note which collection this PR will affect]
Changelog
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information