Audio: handle no-space scripts in transcript guards - #2385
Audio: handle no-space scripts in transcript guards#2385mohammadaaftabv wants to merge 1 commit into
Conversation
Signed-off-by: aaftaabv@gmail.com <aaftaabv@gmail.com>
d9c76fc to
2baa97e
Compare
|
| word_checks_apply = not self._is_scriptio_continua(task) | ||
| repeated = self._repeated_ngrams(words) if word_checks_apply else False | ||
| long_w = ( | ||
| self._long_word(words, threshold=long_word_thresh, skip_relative=is_agglutinative) | ||
| if word_checks_apply | ||
| else False | ||
| ) |
There was a problem hiding this comment.
Language Gate Skips Valid Checks
When a row is labeled with a scriptio-continua language, this code disables both word-based checks regardless of the actual transcript. A Japanese- or Chinese-labeled recording can still produce a whitespace-delimited hallucination such as repeated English tokens. In that case, the repeated-word and long-word checks remain applicable but never run, allowing the hallucinated transcript to pass when it does not match a configured phrase or exceed the character-rate threshold. Restrict the exemption to transcripts that actually exhibit no-space-script characteristics rather than relying only on the source-language label.
Summary
DisfluencyWerGuardStage, using CER for scriptio-continua languages and WER otherwiseThis is a current-
main-native port of the three no-space-script behaviors fromnithinraok/Curator@1e2d639946f28dfd289a0a9456480385d4480c28(feature commitc9b4fb4e532d56978ead910675a2ef86aa62016b). A direct cherry-pick is not viable because currentmainalready contains newer implementations ofWhisperHallucinationStageandSelectBestPredictionStage.Behavior
SCRIPTIO_CONTINUA_LANGUAGE_CODEScovers Japanese, Chinese locale variants, Cantonese, Thai, Lao, Khmer, Burmese, Tibetan, and Dzongkha, matching the reference contract. Missing or space-separated languages retain the existing WER/word-heuristic behavior.The selector keeps main's generic field naming (
primary_fallback_agreement_*) while exposing configurable keys for pipelines that use the reference'somni_asr_agreement_*names.Validation
ruff format --check: passedruff check: passed127 passed2baa97e7903c9bbab0b126bf9ca99cb1d34530041e2d639946f28dfd289a0a9456480385d4480c2822d3baa54b38baa11270ea20111c042f5f488dbf3dc9ddde542e446b1c8aa686The parity run intentionally starts at these deterministic text-filtering stages. No ASR model run is needed: the changed contracts consume already-produced transcript/language/duration fields and do not modify Qwen inference.
Related work
Draft PR #1881 contains an older WER-only baseline. This PR applies only the requested no-space behavior to current
mainand supplies the missing guard without bringing over the unrelated legacy Qwen pipeline stack.