fix(asr): fall back to "text" in cal_write_wer when gt_text_attr_name is missing - #16327
Open
MohammadHijjawi97 wants to merge 1 commit into
Open
MohammadHijjawi97 wants to merge 1 commit into
MohammadHijjawi97 wants to merge 1 commit into
Conversation
… is missing cal_write_wer switches to the "text" field when the configured gt_text_attr_name is absent from a manifest line, but the following `return None, None, eval_metric` sat outside the else branch, so it returned in both cases. As a result WER was silently skipped (without the "Cannot calculate WER" log line) whenever the configured attribute was missing, even if "text" was present. Only return when neither field is present, and log a warning when falling back to "text". Signed-off-by: Mohammad Hijjawi <mohammad.hijjawi1997@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
The
Update branchbutton 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 ?
Make
cal_write_weractually use its fallback to thetextfield whengt_text_attr_nameis missing from the manifest, instead of silently returningNone.Collection: ASR
Changelog
cal_write_wer,return None, None, eval_metricwas indented at the level of the outerif, so it ran even after the code had switchedgt_text_attr_nameto"text". WER was then skipped with no log message whenever the configured attribute was missing, even whentextwas present. The early return now happens only when neither field exists, and a warning is logged when falling back totext.tests/collections/asr/utils/test_eval_utils.py, covering normal WER, the fallback, and the no-ground-truth case.Usage
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
Trusted PRs run automatically through copy-pr-bot. For an untrusted PR, a maintainer can trigger CI by commenting
/ok to test <head-sha>; repeat this after a new push if the PR remains untrusted.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
pytest --noconftest tests/collections/asr/utils/test_eval_utils.py tests/collections/asr/inference/test_pipeline_eval.pygives 8 passed, and the fallback test fails onmain.pre-commit runis clean.cal_write_text_metrichas the same indentation, but I left it unchanged on purpose. The streaming pipeline calls it for BLEU withgt_text_attr_name: answerand expects it to skip when the translation reference is missing. Falling back totextthere would score translations against the source transcript.