NeMo icon indicating copy to clipboard operation
NeMo copied to clipboard

Punctuation Marks in Timestamps

Open monica-sekoyan opened this issue 8 months ago • 1 comments

[!IMPORTANT]
The Update branch button must only be pressed in very rare occassions. An outdated branch is never blocking the merge of a PR. Please reach out to the automation team before pressing that button.

What does this PR do ?

This is for removing discrepancies between the hypothesis.text and words or segments we have in hypothesis.timestamps.

One example of such discrepancy:

previously it was like this:

hypothesis.text = "Haitański instytut sprawiedliwości i Demokracji odniósł się do niezależnych badań sugerujących, że napalski batalion Pokojowy ONZ bezwiednie przenieść choroby na Haiti"

hypothesis.timestamp["segment"] = [{'end': 9.44,
  'end_offset': 118,
  'segment': 'Haitański instytut sprawiedliwości i Demokracji odniósł się do '
             'niezależnych badań sugerujących , że napalski batalion Pokojowy '
             'ONZ bezwiednie przenieść choroby na Haiti',
  'start': 0.0,
  'start_offset': 0}]

See the space before the comma in the segment text and not in the transcription. With this PR it is removed. The same is with the word-level timestamps.

Collection: [Note which collection this PR will affect]

Changelog

  • Add specific line by line info of high level changes in this PR.

Usage

  • You can potentially add a usage example below
# Add a code snippet demonstrating how to use this 

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:

  • [ ] Make sure you read and followed Contributor guidelines
  • [ ] Did you write any new necessary tests?
  • [ ] Did you add or update any necessary documentation?
  • [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • [ ] Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • [ ] New Feature
  • [ ] Bugfix
  • [ ] Documentation

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

  • Related to # (issue)

monica-sekoyan avatar Apr 30 '25 14:04 monica-sekoyan

@monica-sekoyan can you add some tests, please?

artbataev avatar Apr 30 '25 15:04 artbataev

@artbataev , thanks for the review.

Also, most of the code in the implementation for RNN-T vs CTC is duplicated. Is making stand-alone universal functions (separate for char/bpe) without code duplication possible? If possible, please merge them. If not, it's ok, and it's not a blocker.

As discussed with @nithinraok , rnnt and ctc need unified abstract class, because as you mentioned most of the code is duplicated. And for this greater refactoring is needed, which I guess should not be included in this PR.

@nithinraok , @artbataev do you agree?

monica-sekoyan avatar May 16 '25 17:05 monica-sekoyan

@monica-sekoyan @artbataev yeah lets not push cleaning of decoding methods in this PR. It should be a separate work.

nithinraok avatar May 16 '25 17:05 nithinraok