Repository navigation
fix(asr): exclude <unk> token from language tag extraction - #113
utkarshpatwa393-sys wants to merge 1 commit into
Conversation
The language tag regex pattern <([A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,4})?)>
matches three-letter tokens, causing <unk> from the tokenizer vocabulary
to be treated as language code "unk". This pollutes detected_languages,
corrupts ITN grammar selection in auto mode, and inadvertently strips
unknown tokens from the output transcript.
Filter out "unk" during tag extraction and only erase recognized
language tags from the transcript text.
Fixes NVIDIA#92
Signed-off-by: Utkarsh Patwa <utkarshpatwa393@gmail.com>
|
No actionable comments were generated in the recent review. Summary
Severity of issue fixed: Low Merge Risk:
|
[Medium impact] The PR appears safe to merge. Summary
Reviews (1) · Last reviewed commit: "fix(asr): exclude <unk> token from langu..." · Reviewed by Greptile |
Summary
Fixes #92.
In
src/asr/runner.cpp,extract_lang_tagsuses the regex pattern:<([A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,4})?)>Because
<unk>has 3 alphabetic characters, it matches this pattern and is inadvertently extracted as a language code ("unk"). When this happens:"unk"is added todetected_languages_, pollutinglanguage_codes, CLI outputs, and REST responses.automode,build_result_may attempt to select an ITN grammar using"unk"instead of the genuine detected language.<unk>token is stripped from the text output as if it were a language tag.Changes
"unk"(case-insensitive) during language tag collection inextract_lang_tags.text, leaving<unk>tokens intact in the transcript.