Get forced alignments from CTC model#6248
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces forced alignment capabilities for CTC models. The implementation looks solid and is accompanied by relevant tests. I've identified two high-severity issues in the new code. One is a potential correctness issue in espnet2/asr/ctc.py where a precondition for an external function is not validated, which could lead to incorrect results or cryptic errors. The other is in espnet2/s2t/espnet_model.py regarding an in-place modification of an input tensor, which is a dangerous side-effect and can cause subtle bugs. I've provided suggestions to address both.
for more information, see https://pre-commit.ci
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Thanks! |
|
Also, please fix the CI errors |
for more information, see https://pre-commit.ci
Thanks for review. Added an example here - |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #6248 +/- ##
=======================================
Coverage 56.77% 56.78%
=======================================
Files 889 889
Lines 84340 84361 +21
=======================================
+ Hits 47882 47902 +20
- Misses 36458 36459 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Hi, this is ready to be merged. |
|
OK, thanks! |
What did you change?
Add forced alignment outputs based on CTC posteriors for the S2T model.
Why did you make this change?
To get forced alignments from any CTC models in ESPnet.
Is your PR small enough?
Yes